This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
Open
Description
What is problem I'd like to solve?
For class with argumented initializer, shoegaze doesn't mock class initialize
function, then instantiation like FakeClass.proxy.new(args)
fails with following error:
1) FakeTest works with customized initializer in shoegaze
Failure/Error: subject { FakeTest.proxy.new("dummy") }
ArgumentError:
wrong number of arguments (given 1, expected 0)
How to reproduce
class TestClass
def initialize(dummy)
end
end
class FakeTest < Shoegaze::Mock
mock "TestClass"
implement_instance_method :initialize do
default do
datasource do |*arg|
"instance method implementation doesn't help, \
because `missing_method` wasn't hit at all."
end
end
end
end
describe FakeTest do
subject { FakeTest.proxy.new("dummy") }
it "works with customized initializer in shoegaze" do
expect(subject).to be_kind_of Shoegaze::Proxy::Template
end
end
Metadata
Assignees
Labels
No labels