Skip to content

Instantly share code, notes, and snippets.

@KushalP
Created February 29, 2012 15:05
Show Gist options
  • Save KushalP/1941385 to your computer and use it in GitHub Desktop.
Save KushalP/1941385 to your computer and use it in GitHub Desktop.
This breaks in rcov when running: `rcov play.rb play_spec.rb`
module Play
class Dummy
attr :count
def initialize
@count = 0
end
def gaga
@count += 1
'ga ga'
end
end
end
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