spec/provider/releases_spec.rb in dpl-releases-1.10.6.travis.3118.5 vs spec/provider/releases_spec.rb in dpl-releases-1.10.6.travis.3119.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(:exist?).with("test/foo.bar").and_return(true) + expect(File).to receive(:exist?).with("bar.txt").and_return(true) 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") @@ -183,10 +185,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(:exist?).with("test/foo.bar").and_return(true) + expect(File).to receive(:exist?).with("bar.txt").and_return(true) 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") @@ -195,11 +199,11 @@ end allow(provider.api).to receive(:release_assets).and_return([double(:name => "foo.bar", :url => 'foo-bar-url'), double(:name => "foo.foo", :url => 'foo-foo-url')]) expect(provider.api).to receive(:upload_asset).with(anything, "bar.txt", {:name=>"bar.txt", :content_type=>"text/plain"}) - expect(provider).to receive(:log).with("foo.bar already exists, skipping.") + allow(provider).to receive(:log) expect(provider.api).to receive(:update_release).with(anything, hash_including(:draft => false)) provider.push_app end @@ -209,10 +213,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(:exist?).with("exists.txt").and_return(true) 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}) @@ -232,10 +237,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(:exist?).with("test/foo.bar").and_return(true) + expect(File).to receive(:exist?).with("bar.txt").and_return(true) 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") @@ -261,10 +268,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(:exist?).with("bar.txt").and_return(true) expect(File).to receive(:file?).with("bar.txt").and_return(true) allow(provider.api).to receive(:release_assets).and_return([]) expect(provider.api).to receive(:upload_asset).with("https://api.github.com/repos/foo/bar/releases/1234", "bar.txt", {:name=>"bar.txt", :content_type=>"text/plain"}) @@ -278,10 +286,11 @@ 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(:exist?).with("bar.txt").and_return(true) expect(File).to receive(:file?).with("bar.txt").and_return(true) allow(provider.api).to receive(:release_assets).and_return([]) expect(provider.api).to receive(:upload_asset).with("https://api.github.com/repos/foo/bar/releases/1234", "bar.txt", {:name=>"bar.txt", :content_type=>"text/plain"}) @@ -295,10 +304,11 @@ provider.options.update(:file => ["bar.txt"]) provider.options.update(:release_number => "1234") provider.options.update(:prerelease => 'true') allow(provider).to receive(:slug).and_return("foo/bar") + expect(File).to receive(:exist?).with("bar.txt").and_return(true) expect(File).to receive(:file?).with("bar.txt").and_return(true) allow(provider.api).to receive(:release_assets).and_return([]) expect(provider.api).to receive(:upload_asset).with("https://api.github.com/repos/foo/bar/releases/1234", "bar.txt", {:name=>"bar.txt", :content_type=>"text/plain"}) @@ -313,9 +323,10 @@ provider.options.update(:file => ["bar.txt"]) provider.options.update(:release_number => "1234") provider.options.update(:prerelease => 'true') provider.options.update(:name => 'true') allow(provider).to receive(:slug).and_return("foo/bar") + expect(File).to receive(:exist?).with("bar.txt").and_return(true) expect(File).to receive(:file?).with("bar.txt").and_return(true) allow(provider.api).to receive(:release_assets).and_return([]) expect(provider.api).to receive(:upload_asset).with("https://api.github.com/repos/foo/bar/releases/1234", "bar.txt", {:name=>"bar.txt", :content_type=>"text/plain"})