Permalink
Browse files

Infer class with rspec's described_class method

  • Loading branch information...
1 parent 75b556e commit af151bc1db46bd502be1654f5177e5875a829655 @stevehodgkiss committed Apr 19, 2011
@@ -17,6 +17,7 @@ def fake_test_case; end
def add_assertion; end
end
self.test_case_instance = self.test_case.new(:fake_test_case)
+ self.test_case.tests described_class
end
module ClassMethods
@@ -2,7 +2,6 @@
describe TestGenerator, "using custom matcher" do
include GeneratorSpec::TestCase
- tests TestGenerator
destination File.expand_path("../../tmp", __FILE__)
arguments %w(test --test)
@@ -7,6 +7,7 @@ class TestClass
describe GeneratorSpec::TestCase do
before do
@klass = Class.new do
+ self.should_receive(:described_class).and_return(TestClass)
include GeneratorSpec::TestCase
end
@klass.test_case_instance = mock
@@ -25,7 +26,6 @@ class TestClass
describe TestGenerator, "using normal assert methods" do
include GeneratorSpec::TestCase
- tests TestGenerator
destination File.expand_path("../../tmp", __FILE__)
arguments %w(test --test)
@@ -49,7 +49,6 @@ class TestClass
describe TestGenerator, "with contexts" do
include GeneratorSpec::TestCase
- tests TestGenerator
destination File.expand_path("../../tmp", __FILE__)
before { prepare_destination }

0 comments on commit af151bc

Please sign in to comment.