mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Swap label and expected value parameters
This matches the partial initializer parameters. Also cleaned up some code in the Expectation spec.
This commit is contained in:
parent
f3e50c6432
commit
5ba03a90ff
20 changed files with 74 additions and 110 deletions
|
@ -8,17 +8,17 @@ def new_partial(actual : T = 123) forall T
|
|||
Spectator::Expectations::ValueExpectationPartial.new(actual, __FILE__, __LINE__)
|
||||
end
|
||||
|
||||
def new_matcher(label : String, expected : T) forall T
|
||||
Spectator::Matchers::EqualityMatcher.new(label, expected)
|
||||
def new_matcher(expected : T, label : String) forall T
|
||||
Spectator::Matchers::EqualityMatcher.new(expected, label)
|
||||
end
|
||||
|
||||
def new_matcher(expected : T = 123) forall T
|
||||
new_matcher(expected.to_s, expected)
|
||||
Spectator::Matchers::EqualityMatcher.new(expected)
|
||||
end
|
||||
|
||||
def new_expectation(expected : ExpectedType = 123, actual : ActualType = 123) forall ExpectedType, ActualType
|
||||
partial = new_partial(actual, "foo")
|
||||
matcher = new_matcher("bar", expected)
|
||||
matcher = new_matcher(expected, "bar")
|
||||
match_data = matcher.match(partial)
|
||||
Spectator::Expectations::Expectation.new(match_data, false)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue