mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix oddity with type being unresolvable
This commit is contained in:
parent
c1f61d68bf
commit
26187a0f31
2 changed files with 10 additions and 4 deletions
|
@ -35,9 +35,15 @@ def new_unsatisfied_expectation(expected : ExpectedType = 123, actual : ActualTy
|
|||
end
|
||||
end
|
||||
|
||||
def create_expectations(success_count = 1, failure_count = 0)
|
||||
satisfied = Array(Spectator::Expectations::Expectation).new(success_count) { new_satisfied_expectation }
|
||||
unsatisfied = Array(Spectator::Expectations::Expectation).new(failure_count) { new_unsatisfied_expectation }
|
||||
(satisfied + unsatisfied).shuffle
|
||||
end
|
||||
|
||||
def generate_expectations(success_count = 1, failure_count = 0)
|
||||
satisfied = Array.new(success_count) { new_satisfied_expectation }
|
||||
unsatisfied = Array.new(failure_count) { new_unsatisfied_expectation }
|
||||
satisfied = Array(Spectator::Expectations::Expectation).new(success_count) { new_satisfied_expectation }
|
||||
unsatisfied = Array(Spectator::Expectations::Expectation).new(failure_count) { new_unsatisfied_expectation }
|
||||
expectations = (satisfied + unsatisfied).shuffle
|
||||
reporter = Spectator::Expectations::ExpectationReporter.new(false)
|
||||
expectations.each do |expectation|
|
||||
|
|
|
@ -8,7 +8,7 @@ def new_successful_result(
|
|||
Spectator::SuccessfulResult.new(
|
||||
example || PassingExample.create,
|
||||
elapsed || Time::Span.zero,
|
||||
expectations || Spectator::Expectations::ExampleExpectations.new(generate_expectations(1, 0)[:expectations])
|
||||
expectations || Spectator::Expectations::ExampleExpectations.new([new_satisfied_expectation])
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -69,7 +69,7 @@ describe Spectator::SuccessfulResult do
|
|||
|
||||
describe "#expectations" do
|
||||
it "is the expected value" do
|
||||
expectations = Spectator::Expectations::ExampleExpectations.new(generate_expectations(5, 0)[:expectations])
|
||||
expectations = Spectator::Expectations::ExampleExpectations.new(create_expectations(5, 0))
|
||||
result = new_successful_result(expectations: expectations)
|
||||
result.expectations.should eq(expectations)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue