Skip to content

Instantly share code, notes, and snippets.

@mostlyobvious
Created May 28, 2013 17:30
Show Gist options
  • Save mostlyobvious/5664500 to your computer and use it in GitHub Desktop.
Save mostlyobvious/5664500 to your computer and use it in GitHub Desktop.
require 'bogus/rspec'
class Foo
def bar(baz, default = nil)
end
end
describe 'default arguments' do
fake(:foo)
specify do
arg = "dummy"
foo.bar(arg)
expect(foo).to have_received.bar(arg) # this fails but I belive it should not
expect(foo).to have_received.bar(arg, {}) # somehow this is expected
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment