Skip to content

Commit

Permalink
Change to 3.0 compatible syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mbj committed Oct 18, 2020
1 parent 9e5068e commit e9df5dc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def parse_expression(string)
module XSpecHelper
def verify_events(&block)
expectations = raw_expectations
.map(&XSpec::MessageExpectation.method(:parse))
.map { |attributes| XSpec::MessageExpectation.parse(**attributes) }

XSpec::ExpectationVerifier.verify(self, expectations, &block)
end
Expand Down
6 changes: 5 additions & 1 deletion spec/support/xspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ def validate_block_arity(observation, yields)

# block allows anything we can skip the check
return if observed.equal?(-1)
fail 'Optargs currently not supported' if observed < -1

if observed.negative?
observed = observed.succ.abs
end

block_arity_mismatch(observation, expected, observed) unless expected.equal?(observed)
end

Expand Down
8 changes: 4 additions & 4 deletions spec/unit/mutant/isolation/fork_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def apply
*read_fragments,
load_success,
child_wait
].map(&XSpec::MessageExpectation.method(:parse))
].map { |attributes| XSpec::MessageExpectation.parse(**attributes) }
end

specify do
Expand Down Expand Up @@ -235,7 +235,7 @@ def apply
}
},
child_wait
].map(&XSpec::MessageExpectation.method(:parse))
].map { |attributes| XSpec::MessageExpectation.parse(**attributes) }
end

specify do
Expand All @@ -258,7 +258,7 @@ def apply
return: nil
}
}
].map(&XSpec::MessageExpectation.method(:parse))
].map { |attributes| XSpec::MessageExpectation.parse(**attributes) }
end

specify do
Expand Down Expand Up @@ -296,7 +296,7 @@ def apply
return: [pid, status_error]
}
}
].map(&XSpec::MessageExpectation.method(:parse))
].map { |attributes| XSpec::MessageExpectation.parse(**attributes) }
end

specify do
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/mutant/parallel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def ivar(value, **attributes)
}
end

def mvar(*arguments)
ivar(*arguments).merge(receiver: Variable::MVar)
def mvar(value, **arguments)
ivar(value, **arguments).merge(receiver: Variable::MVar)
end

let(:raw_expectations) do
Expand Down

0 comments on commit e9df5dc

Please sign in to comment.