spec/lib/onebox/layout_spec.rb in onebox-1.5.17 vs spec/lib/onebox/layout_spec.rb in onebox-1.5.18
- old
+ new
@@ -14,24 +14,20 @@
Onebox.options.load_paths << "directory_b"
end
context "when template exists in directory_b" do
before(:each) do
- allow_any_instance_of(described_class).to receive(:template?) do |path|
- path == "directory_b"
- end
+ allow_any_instance_of(described_class).to receive(:template?) { |_,path| path == "directory_b" }
end
it "returns directory_b" do
expect(template_path).to eq("directory_b")
end
end
context "when template exists in directory_a" do
before(:each) do
- allow_any_instance_of(described_class).to receive(:template?) do |path|
- path == "directory_a"
- end
+ allow_any_instance_of(described_class).to receive(:template?) { |_,path| path == "directory_a" }
end
it "returns directory_a" do
expect(template_path).to eq("directory_a")
end