Created
August 30, 2012 23:20
-
-
Save epinault/3544674 to your computer and use it in GitHub Desktop.
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 'minitest/spec' | |
require 'minitest/autorun' | |
require 'minitest/mock' | |
class A | |
def method1(url) | |
submethod(url) | |
end | |
def submethod(url) | |
puts 'do something' | |
end | |
end | |
describe 'lambda issue' do | |
before :each do | |
@obj = A.new | |
end | |
it "should not break when using lambda" do | |
@obj.stub :submethod, lambda{raise('hello')} do | |
@obj.method1('hi') | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
require 'minitest/spec'
require 'minitest/autorun'
require 'minitest/mock'
class A
def submethod url
raise "you should not see this"
end
def method1
url = "xxxx"
submethod(url)
end
end
describe 'lambda issue' do
before :each do
@obj = A.new
end
it "should not break when using lambda" do
@obj.stub :submethod, lambda{ raise('hello') } do
@obj.method1
end
end
end