Skip to content

#initialize instance private method issue #23

@ulugbekov

Description

@ulugbekov

mock_model("Book")

allow(Book).to receive(:new).with({}) { book_instance }

Wrong number of arguments. Expected 0, got 1.
The reason is Book.instance_method(:initialize).arity is 0;
Which is supposed to be -1. Book.new takes *args, so initialize is failing when testing with RSpec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions