Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

get described_class to point to the right thing

  • Loading branch information...
commit 12615bab475c5d95dfb88e4ba4df3532b1970342 1 parent 8f53c52
@dchelimsky dchelimsky authored
View
4 lib/rspec/core/example.rb
@@ -13,10 +13,6 @@ def description
@metadata[:description]
end
- def described_class
- @metadata[:describes]
- end
-
def record_results(results={})
@metadata[:execution_result].update(results)
end
View
4 lib/rspec/core/example_group.rb
@@ -209,6 +209,10 @@ def assignments
@assignments ||= {}
end
+ def described_class
+ running_example.metadata[:behaviour][:describes]
+ end
+
def __reset__
instance_variables.each { |ivar| remove_instance_variable(ivar) }
assignments.clear
View
4 spec/rspec/core/example_spec.rb
@@ -43,8 +43,8 @@
end
describe '#described_class' do
- it "is a shortcut to ...." do
- @example.described_class.should == @example.metadata[:describes]
+ it "returns the class (if any) of the outermost example group" do
+ described_class.should == Rspec::Core::Example
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.