From bf4131af17f34d39a240fd235bb69da7c9e3f0a0 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Sun, 28 Jul 2013 20:08:53 -0300 Subject: [PATCH] Clean up downloader test a bit --- test/unit/vagrant/util/downloader_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/vagrant/util/downloader_test.rb b/test/unit/vagrant/util/downloader_test.rb index 7968700b1..1f73d57b8 100644 --- a/test/unit/vagrant/util/downloader_test.rb +++ b/test/unit/vagrant/util/downloader_test.rb @@ -21,12 +21,14 @@ describe Vagrant::Util::Downloader do end describe "#download!" do + let(:curl_options) { + ["--fail", "--location", "--max-redirs", "10", "--user-agent", described_class::USER_AGENT, "--output", destination, source, {}] + } + context "with a good exit status" do let(:exit_code) { 0 } it "downloads the file and returns true" do - curl_options = ["--fail", "--location", "--max-redirs", "10", "--user-agent", described_class::USER_AGENT, "--output", destination, source, {}] - Vagrant::Util::Subprocess.should_receive(:execute). with("curl", *curl_options). and_return(subprocess_result) @@ -39,8 +41,6 @@ describe Vagrant::Util::Downloader do let(:exit_code) { 1 } it "raises an exception" do - curl_options = ["--fail", "--location", "--max-redirs", "10", "--user-agent", described_class::USER_AGENT, "--output", destination, source, {}] - Vagrant::Util::Subprocess.should_receive(:execute). with("curl", *curl_options). and_return(subprocess_result)