Permalink
Browse files

Use RSpec's `expect/to` notation instead of `lambda/should`

  • Loading branch information...
1 parent dbc70bb commit 0589c0931f350e7af848b19e1a7d6aa8b93a5acb @samleb committed Jan 16, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 spec/active_record_spec.rb
@@ -59,17 +59,17 @@ class ::TempUser < ActiveRecord::Base; end
ruby_19 do
it "should return a Method object for an existing column" do
- lambda { TempUser.method(:username) }.should_not raise_error
+ expect { TempUser.method(:username) }.to_not raise_error
end
end
it "should raise NoMethodError for a non-existing column" do
TempUser.should_not respond_to(:foobar)
- lambda { TempUser.foobar }.should raise_error NoMethodError
+ expect { TempUser.foobar }.to raise_error NoMethodError
end
it "should not raise error when table doesn't exist" do
TempUser.table_name = "inexistent_users"
- lambda { TempUser.respond_to?(:username) }.should_not raise_error
+ expect { TempUser.respond_to?(:username) }.to_not raise_error
end
end

0 comments on commit 0589c09

Please sign in to comment.