Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Make MethodSignatureVerifier args argument optional. #282

Merged
merged 2 commits into from
May 27, 2016
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
2 changes: 1 addition & 1 deletion lib/rspec/support/method_signature_verifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def classify_parameters
class MethodSignatureVerifier
attr_reader :non_kw_args, :kw_args, :min_non_kw_args, :max_non_kw_args

def initialize(signature, args)
def initialize(signature, args=[])
@signature = signature
@non_kw_args, @kw_args = split_args(*args)
@min_non_kw_args = @max_non_kw_args = @non_kw_args
Expand Down
4 changes: 2 additions & 2 deletions spec/rspec/support/method_signature_verifier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def valid?(*args)
end

def error_description
described_class.new(signature, []).error_message[/Expected (.*),/, 1]
described_class.new(signature).error_message[/Expected (.*),/, 1]
end

def error_for(*args)
Expand All @@ -37,7 +37,7 @@ def validate_expectation(*args)

obj.keywords = args

described_class.new(signature, []).with_expectation(obj).valid?
described_class.new(signature).with_expectation(obj).valid?
end

shared_context 'a method verifier' do
Expand Down