spec/provider/releases_spec.rb in dpl-releases-1.9.2.travis.2725.5 vs spec/provider/releases_spec.rb in dpl-releases-1.9.2.travis.2737.5

- old
+ new

@@ -158,10 +158,12 @@ provider.options.update(:file => ["test/foo.bar", "bar.txt"]) allow(provider).to receive(:releases).and_return([""]) allow(provider).to receive(:get_tag).and_return("v0.0.0") + expect(File).to receive(:file?).with("test/foo.bar").and_return(true) + expect(File).to receive(:file?).with("bar.txt").and_return(true) provider.releases.map do |release| allow(release).to receive(:tag_name).and_return("v0.0.0") allow(release).to receive(:rels).and_return({:self => nil}) allow(release.rels[:self]).to receive(:href) @@ -184,10 +186,12 @@ provider.options.update(:file => ["test/foo.bar", "bar.txt"]) allow(provider).to receive(:releases).and_return([""]) allow(provider).to receive(:get_tag).and_return("v0.0.0") + expect(File).to receive(:file?).with("test/foo.bar").and_return(true) + expect(File).to receive(:file?).with("bar.txt").and_return(true) provider.releases.map do |release| allow(release).to receive(:tag_name).and_return("v0.0.0") allow(release).to receive(:rels).and_return({:self => nil}) allow(release.rels[:self]).to receive(:href) @@ -211,10 +215,11 @@ provider.options.update(:file => ["exists.txt"]) provider.options.update(:overwrite => true) allow(provider).to receive(:releases).and_return([""]) allow(provider).to receive(:get_tag).and_return("v0.0.0") + expect(File).to receive(:file?).with("exists.txt").and_return(true) provider.releases.map do |release| allow(release).to receive(:tag_name).and_return("v0.0.0") allow(release).to receive(:rels).and_return({:self => nil}) allow(release.rels[:self]).to receive(:href) @@ -236,10 +241,12 @@ allow_message_expectations_on_nil provider.options.update(:file => ["test/foo.bar", "bar.txt"]) allow(provider).to receive(:releases).and_return([""]) + expect(File).to receive(:file?).with("test/foo.bar").and_return(true) + expect(File).to receive(:file?).with("bar.txt").and_return(true) provider.releases.map do |release| allow(release).to receive(:tag_name).and_return("foo") allow(release).to receive(:rels).and_return({:self => nil}) allow(release.rels[:self]).to receive(:href) @@ -266,10 +273,11 @@ provider.options.update(:file => ["bar.txt"]) provider.options.update(:release_number => "1234") allow(provider).to receive(:slug).and_return("foo/bar") + expect(File).to receive(:file?).with("bar.txt").and_return(true) allow(provider.api).to receive(:release) allow(provider.api.release).to receive(:rels).and_return({:assets => nil}) allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => nil}) allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([]) @@ -284,11 +292,11 @@ allow_message_expectations_on_nil provider.options.update(:file => ["bar.txt"]) provider.options.update(:release_number => "1234") provider.options.update(:draft => true) - allow(provider).to receive(:slug).and_return("foo/bar") + expect(File).to receive(:file?).with("bar.txt").and_return(true) allow(provider.api).to receive(:release) allow(provider.api.release).to receive(:rels).and_return({:assets => nil}) allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => nil}) allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([])