Created
May 27, 2015 18:24
-
-
Save puneetpandey/2d80fa59456a916ea9a1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
'[email protected]' | |
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: '[email protected]', mobile: 12021679918 | |
u.email.should == '[email protected]' | |
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: '[email protected]', mobile: 12021679918 | |
expect(u.email).to eq('[email protected]') | |
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