Skip to content

Commit

Permalink
Use RSpec's expect/to notation instead of lambda/should
Browse files Browse the repository at this point in the history
  • Loading branch information
samleb committed Jan 16, 2013
1 parent dbc70bb commit 0589c09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/active_record_spec.rb
Expand Up @@ -59,17 +59,17 @@ class ::TempUser < ActiveRecord::Base; end


ruby_19 do ruby_19 do
it "should return a Method object for an existing column" 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
end end


it "should raise NoMethodError for a non-existing column" do it "should raise NoMethodError for a non-existing column" do
TempUser.should_not respond_to(:foobar) TempUser.should_not respond_to(:foobar)
lambda { TempUser.foobar }.should raise_error NoMethodError expect { TempUser.foobar }.to raise_error NoMethodError
end end


it "should not raise error when table doesn't exist" do it "should not raise error when table doesn't exist" do
TempUser.table_name = "inexistent_users" 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
end end

0 comments on commit 0589c09

Please sign in to comment.