[rspec-users] Stylistic preferences

Bryan Liles bryan at osesm.com
Mon Dec 3 08:32:13 EST 2007


On Nov 29, 2007, at 5:54 AM, Daniel Tenner wrote:

> What are people's opinions on which of these two styles is better to
> use?
>
>
>   it "should be possible to disable the number" do
>     given(valid_sms_user) do |user|
>       user.save
>       user.disable_number
>       user.should be_disabled
>     end
>   end
>


it "should be possible to disable the number" do
   lambda {
     user.save
     user.disable_number
   }.should change(user, :disabled?).from(true).to(false)
end

If this doesn't work, the solution is very close to this.



More information about the rspec-users mailing list