Add test for value of "what"

Minor changes to remove unused parts.
This commit is contained in:
Michael Miller 2018-11-02 18:23:04 -06:00
parent 7c21f1e3eb
commit 14ee762ad7

View file

@ -182,13 +182,20 @@ describe Spectator::DSL::NestedExampleGroupBuilder do
end end
describe "#build" do describe "#build" do
it "passes along the what value" do
what = "TEST"
builder = Spectator::DSL::NestedExampleGroupBuilder.new(what)
root = Spectator::DSL::RootExampleGroupBuilder.new.build(Spectator::Internals::SampleValues.empty)
group = builder.build(root, Spectator::Internals::SampleValues.empty)
group.what.should eq(what)
end
it "passes along the parent" do it "passes along the parent" do
factory = Spectator::DSL::ExampleFactory.new(SpyExample) factory = Spectator::DSL::ExampleFactory.new(SpyExample)
builder = Spectator::DSL::NestedExampleGroupBuilder.new("foo") builder = Spectator::DSL::NestedExampleGroupBuilder.new("foo")
builder.add_child(factory) builder.add_child(factory)
values = Spectator::Internals::SampleValues.empty.add(:foo, "foo", 12345)
root = Spectator::DSL::RootExampleGroupBuilder.new.build(Spectator::Internals::SampleValues.empty) root = Spectator::DSL::RootExampleGroupBuilder.new.build(Spectator::Internals::SampleValues.empty)
group = builder.build(root, values) group = builder.build(root, Spectator::Internals::SampleValues.empty)
group.parent.should be(root) group.parent.should be(root)
end end