spec/support/helpers/construct_spec_helper.rb in taketo-0.1.3 vs spec/support/helpers/construct_spec_helper.rb in taketo-0.2.0.alpha

- old
+ new

@@ -13,9 +13,18 @@ with(:foo).and_return(:bar) # with(:foo).and_return(:bar) expect(subject.send("find_#{name_singular}", :foo)).to eq(:bar) # expect(environment.find_server(:foo)).to eq(:bar) end # end end +shared_examples "a node with servers" do + it_behaves_like "a construct with nodes", :servers, :server + + specify "#has_servers? should perform deep search on child nodes" do + subject.should_receive(:has_deeply_nested_nodes?).with(:servers) + subject.has_servers? + end +end + module ConstructsFixtures include Taketo::Constructs [Project, Environment, Server].each do |node_type| define_method node_type.name.downcase.gsub(/\w*::/, '') do |name, *args|