mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Uncomment predicate matcher
This commit is contained in:
parent
48363951c2
commit
66dc6bf098
1 changed files with 28 additions and 28 deletions
|
@ -703,33 +703,33 @@ module Spectator
|
||||||
# # Is equivalent to:
|
# # Is equivalent to:
|
||||||
# expect("foobar".has_back_references?).to_not be_true
|
# expect("foobar".has_back_references?).to_not be_true
|
||||||
# ```
|
# ```
|
||||||
# macro method_missing(call)
|
macro method_missing(call)
|
||||||
# {% if call.name.starts_with?("be_") %}
|
{% if call.name.starts_with?("be_") %}
|
||||||
# # Remove `be_` prefix.
|
# Remove `be_` prefix.
|
||||||
# {% method_name = call.name[3..-1] %}
|
{% method_name = call.name[3..-1] %}
|
||||||
# {% matcher = "PredicateMatcher" %}
|
{% matcher = "PredicateMatcher" %}
|
||||||
# {% elsif call.name.starts_with?("have_") %}
|
{% elsif call.name.starts_with?("have_") %}
|
||||||
# # Remove `have_` prefix.
|
# Remove `have_` prefix.
|
||||||
# {% method_name = call.name[5..-1] %}
|
{% method_name = call.name[5..-1] %}
|
||||||
# {% matcher = "HavePredicateMatcher" %}
|
{% matcher = "HavePredicateMatcher" %}
|
||||||
# {% else %}
|
{% else %}
|
||||||
# {% raise "Undefined local variable or method '#{call}'" %}
|
{% raise "Undefined local variable or method '#{call}'" %}
|
||||||
# {% end %}
|
{% end %}
|
||||||
#
|
|
||||||
# descriptor = { {{method_name}}: Tuple.new({{call.args.splat}}) }
|
descriptor = { {{method_name}}: Tuple.new({{call.args.splat}}) }
|
||||||
# label = String::Builder.new({{method_name.stringify}})
|
label = String::Builder.new({{method_name.stringify}})
|
||||||
# {% unless call.args.empty? %}
|
{% unless call.args.empty? %}
|
||||||
# label << '('
|
label << '('
|
||||||
# {% for arg, index in call.args %}
|
{% for arg, index in call.args %}
|
||||||
# label << {{arg}}
|
label << {{arg}}
|
||||||
# {% if index < call.args.size - 1 %}
|
{% if index < call.args.size - 1 %}
|
||||||
# label << ", "
|
label << ", "
|
||||||
# {% end %}
|
{% end %}
|
||||||
# {% end %}
|
{% end %}
|
||||||
# label << ')'
|
label << ')'
|
||||||
# {% end %}
|
{% end %}
|
||||||
# test_value = ::Spectator::TestValue.new(descriptor, label.to_s)
|
test_value = ::Spectator::TestValue.new(descriptor, label.to_s)
|
||||||
# ::Spectator::Matchers::{{matcher.id}}.new(test_value)
|
::Spectator::Matchers::{{matcher.id}}.new(test_value)
|
||||||
# end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue