Created
February 29, 2012 15:05
-
-
Save KushalP/1941385 to your computer and use it in GitHub Desktop.
This breaks in rcov when running: `rcov play.rb play_spec.rb`
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
module Play | |
class Dummy | |
attr :count | |
def initialize | |
@count = 0 | |
end | |
def gaga | |
@count += 1 | |
'ga ga' | |
end | |
end | |
end |
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 'rspec' | |
require 'play' | |
describe Play::Dummy do | |
it "should have a quick output method" do | |
dummy = Play::Dummy.new | |
dummy.gaga().should == 'ga ga' | |
end | |
it "should increment after every call" do | |
dummy = Play::Dummy.new | |
dummy.count.should == 0 | |
dummy.gaga() | |
dummy.gaga() | |
dummy.gaga() | |
dummy.count.should == 3 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment