This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
class User | |
def initialize(args = {}); end | |
def email | |
'someone@example.com' | |
end | |
def mobile | |
12021679918 | |
end | |
end | |
describe User do | |
describe "#initialize with old should way" do | |
it "should set the email and mobile for user" do | |
u = User.new email: 'someone@example.com', mobile: 12021679918 | |
u.email.should == 'someone@example.com' | |
u.mobile.should == 12021679918 | |
end | |
end | |
describe "#initialize with new expect way" do | |
it "expects email and mobile param for user" do | |
u = User.new email: 'someone@example.com', mobile: 12021679918 | |
expect(u.email).to eq('someone@example.com') | |
expect(u.mobile).to eq(12021679918) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment