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
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
factory = Spectator::DSL::ExampleFactory.new(SpyExample)
builder = Spectator::DSL::NestedExampleGroupBuilder.new("foo")
builder.add_child(factory)
values = Spectator::Internals::SampleValues.empty.add(:foo, "foo", 12345)
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)
end