Skip to content

Commit

Permalink
Merge pull request #275 from rspec/fix_accessing_running_example_exam…
Browse files Browse the repository at this point in the history
…ples

Access running example without `example`
  • Loading branch information
JonRowe committed Jun 28, 2013
2 parents c6fa20d + 7c80a56 commit 060070f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/rspec/matchers/matcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def a_method_in_the_example
"method defined in the example"
end

it "can access methods in the running example" do
it "can access methods in the running example" do |example|
RSpec::Matchers.define(:__access_running_example) do
match do |actual|
a_method_in_the_example == "method defined in the example"
Expand All @@ -454,7 +454,7 @@ def a_method_in_the_example
expect(example).to __access_running_example
end

it "raises NoMethodError for methods not in the running_example" do
it "raises NoMethodError for methods not in the running_example" do |example|
RSpec::Matchers.define(:__raise_no_method_error) do
match do |actual|
a_method_not_in_the_example == "method defined in the example"
Expand Down

0 comments on commit 060070f

Please sign in to comment.