Permalink
Browse files

add wip feature for scoped matcher

  • Loading branch information...
1 parent e89831f commit 40729d06c46c9793bd22b1e40e57a4e5aa82f0e3 @dchelimsky dchelimsky committed Jun 9, 2010
Showing with 29 additions and 0 deletions.
  1. +29 −0 features/matchers/define_matcher.feature
@@ -191,3 +191,32 @@ Feature: define matcher
Then the exit status should be 0
And the stdout should contain "1 example, 0 failures"
+ Scenario: scoped
+ Given a file named "scoped_matcher_spec.rb" with:
+ """
+ require 'rspec/expectations'
+
+ module MyHelpers
+ extend RSpec::Matchers::DSL
+
+ define :be_just_like do |expected|
+ match {|actual| actual == expected}
+ end
+ end
+
+ describe "group with MyHelpers" do
+ include MyHelpers
+ it "has access to the defined matcher" do
+ self.should respond_to(:be_just_like)
+ end
+ end
+
+ describe "group without MyHelpers" do
+ it "does not have access to the defined matcher" do
+ self.should_not respond_to(:be_just_like)
+ end
+ end
+ """
+
+ When I run "rspec ./scoped_matcher_spec.rb"
+ Then the stdout should contain "1 failure"

0 comments on commit 40729d0

Please sign in to comment.