rspec - Test if a method is called by an object -
i new rspec , rails. want test execute method won't called if run method not run confirm true. how should write rspec test?
class release def run(confirm=false) execute if confirm end def execute # end
end
it "should not execute without confirmation" release = release.new release.run expect(release).not_to have_received(:execute) end
Comments
Post a Comment