Permalink
Browse files

add cuke for accessing example from within the example

  • Loading branch information...
1 parent a9ed36a commit b00736221aeecd3b3a44888517ff0037a63a6b65 @dchelimsky dchelimsky committed Mar 24, 2011
Showing with 19 additions and 2 deletions.
  1. +17 −0 features/metadata/current_example.feature
  2. +2 −2 features/metadata/described_class.feature
@@ -0,0 +1,17 @@
+Feature: current example
+
+ You can reference the example object, and access its metadata, using
+ the `example` method within an example.
+
+ Scenario: access the example object from within an example
+ Given a file named "spec/example_spec.rb" with:
+ """
+ describe "an example" do
+ it "knows itself as example" do
+ example.description.should eq("knows itself as example")
+ end
+ end
+ """
+ When I run "rspec spec/example_spec.rb"
+ Then the example should pass
+
@@ -12,6 +12,6 @@ Feature: described class
end
end
"""
- When I run "rspec ./spec/example_spec.rb"
- Then the examples should all pass
+ When I run "rspec spec/example_spec.rb"
+ Then the example should pass

0 comments on commit b007362

Please sign in to comment.