Sha256: 0acb578ae510f2ca92331745b21a7f275fc1072e1587fd1a730e3a4a0abc0d3b
Contents?: true
Size: 605 Bytes
Versions: 10
Compression:
Stored size: 605 Bytes
Contents
# greeter.rb # # Based on http://glu.ttono.us/articles/2006/12/19/tormenting-your-tests-with-heckle # # Run with: # # spec greeter_spec.rb --heckle Greeter # class Greeter def initialize(person = nil) @person = person end def greet @person.nil? ? "Hi there!" : "Hi #{@person}!" end end describe "Greeter" do it "should say Hi to person" do greeter = Greeter.new("Kevin") greeter.greet.should == "Hi Kevin!" end it "should say Hi to nobody" do greeter = Greeter.new # Uncomment the next line to make Heckle happy #greeter.greet.should == "Hi there!" end end
Version data entries
10 entries across 10 versions & 1 rubygems