On Mon, Sep 22, 2008 at 1:21 PM, Ashley Moran
<[EMAIL PROTECTED]> wrote:
> Hi
>
> Where do you include matcher modules in Cucumber so they don't pollute
> Object? ie so
>
> module TwitterMatchers
> class HaveUserStatus
> # ...
> end
>
> def have_user_status(user, status)
> HaveUserStatus.new(user, status)
> end
> end
>
> is only visible in
>
> Then "it should push an announcement to Twitter" do
> t = Twitter::Base.new("dummy_user", "secret", :api_host => "localhost",
> :api_port => 7002)
> t.should have_user_status("followme_ann", "Story title [EMAIL PROTECTED]")
> end
>
> (Actually I'm not convinced it's necessary in this case, but anyway.)
>
> I had a look at the Cucumber examples but none of them use custom matchers.
>
# Put this in steps/env.rb
World do
w = Object.new
w.extend(TwitterMatchers)
w
end
Aslak
> Thanks
> Ashley
>
>
> --
> http://www.patchspace.co.uk/
> http://aviewfromafar.net/
>
>
>
> _______________________________________________
> rspec-users mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users