> > hi there, > In a step I need to assert (don't know hoe to translate this into "should" > terms) state before keep going, example: > > Given "I have signed up as tom who is an admin" do |user, role| do > # call some steps to create user tom > > end >
oops, sorry that was gone unfinished! Given "I have signed up as tom who is an admin" do |user, role| do # call some steps to create user tom # I need to assert that tom really have the rol (this is not the most important, so please bear with me) user_should_have_role user, role end that as you see is not very pretty, I would like to do: Spec::Matchers.define :have_rol do |role| match do |user| user.roles.collect{ |r| r.name }.include?(role) end end and then "assert": tom.should have_role role only I don't get to load the matcher. how you normally load custom machters to be used in cucumber? thanks in advance joaquin -- www.least-significant-bit.com
_______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users