mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add test for SampleValues#each
This commit is contained in:
parent
62549aae88
commit
5a87753c7d
1 changed files with 19 additions and 0 deletions
|
@ -87,4 +87,23 @@ describe Spectator::Internals::SampleValues do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#each" do
|
||||||
|
it "yields each entry" do
|
||||||
|
symbols = [:one, :two, :three]
|
||||||
|
numbers = [123, 456, 789]
|
||||||
|
values = Spectator::Internals::SampleValues.empty
|
||||||
|
symbols.zip(numbers).each do |symbol, number|
|
||||||
|
values = add_sample_value(values, symbol, symbol.to_s, number)
|
||||||
|
end
|
||||||
|
|
||||||
|
size = 0
|
||||||
|
values.each do |entry|
|
||||||
|
size += 1
|
||||||
|
symbol = symbols.find { |s| s.to_s == entry.name }
|
||||||
|
symbol.should_not be_nil
|
||||||
|
end
|
||||||
|
size.should eq(symbols.size)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue