Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/flexmock/composite_expectation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ class FlexMock
# A composite expectation allows several expectations to be grouped into a
# single composite and then apply the same constraints to all expectations
# in the group.
class CompositeExpectation
class CompositeExpectation < BasicObject
attr_reader :expectations

# Initialize the composite expectation.
def initialize
Expand Down
2 changes: 1 addition & 1 deletion lib/flexmock/expectation_recorder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def method_missing(sym, *args, &block)
def apply(mock)
obj = mock
@expectations.each do |sym, args, block|
obj = obj.send(sym, *args, &block)
obj = obj.__send__(sym, *args, &block)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/should_receive_ruby21plus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def test_with_signature_matching_sets_up_the_signature_predicate_based_on_the_pr
k = Class.new { def m(req_a:, req_b:, opt_c: 10, **kw_splat); end }
FlexMock.use do |mock|
e = mock.should_receive(:test).with_signature_matching(k.instance_method(:m))
e = e.instance_variable_get(:@expectations).first
e = e.expectations.first
validator = e.instance_variable_get(:@signature_validator)
assert_equal 0, validator.required_arguments
assert_equal 0, validator.optional_arguments
Expand Down
4 changes: 2 additions & 2 deletions test/should_receive_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ def test_with_signature_matching_sets_up_the_signature_predicate_based_on_the_pr
k = Class.new { def m(req_a, req_b, opt_c = 10); end }
FlexMock.use do |mock|
e = mock.should_receive(:m).with_signature_matching(k.instance_method(:m))
e = e.instance_variable_get(:@expectations).first
e = e.expectations.first
validator = e.instance_variable_get(:@signature_validator)
assert_equal 2, validator.required_arguments
assert_equal 1, validator.optional_arguments
Expand All @@ -1545,7 +1545,7 @@ def test_with_signature_matching_sets_up_the_signature_predicate_based_on_the_pr
k = Class.new { def m(req_a, req_b, opt_c = 10, *splat); end }
FlexMock.use do |mock|
e = mock.should_receive(:m).with_signature_matching(k.instance_method(:m))
e = e.instance_variable_get(:@expectations).first
e = e.expectations.first
validator = e.instance_variable_get(:@signature_validator)
assert_equal 2, validator.required_arguments
assert_equal 1, validator.optional_arguments
Expand Down