Created
March 21, 2011 01:28
-
-
Save andyl/878879 to your computer and use it in GitHub Desktop.
Rspec Stub Test
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
# test1_spec.rb - run this using "rspec test1_spec.rb" | |
require 'rspec' | |
class Test1 | |
def initialize | |
sayhi | |
end | |
def sayhi | |
puts "HI" | |
end | |
end | |
describe Test1 do | |
it "should work" do | |
Test1.stub!(:sayhi).and_return("") | |
Test1.new.should_not be_nil | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment