Created
January 26, 2012 21:29
-
-
Save panthomakos/1685236 to your computer and use it in GitHub Desktop.
Simplified Version of user_presenter_spec.rb from DestroyAllSoftware
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
class Module | |
alias :let :define_method | |
end | |
UserPresenter = Struct.new(:user) do | |
let(:full_name){ [user.first_name, user.last_name].join(' ') } | |
end | |
describe UserPresenter do | |
let(:user){ stub(:user, :first_name => 'Bob', :last_name => 'Smith') } | |
it "presents user's full name" do | |
UserPresenter.new(user).full_name.should == 'Bob Smith' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment