spec/mortar/command/version_spec.rb in mortar-0.14.0 vs spec/mortar/command/version_spec.rb in mortar-0.14.1

- old
+ new

@@ -25,11 +25,11 @@ end base_url = "http://install.mortardata.com" base_version = "1.0" tmp_dir_dumm = "/opt/mortar/installer" - curl_command = "sudo curl -sS -L -o #{tmp_dir_dumm}/install.sh #{base_url} && sudo bash #{tmp_dir_dumm}/install.sh" + curl_command = "sudo mkdir -p #{tmp_dir_dumm} && sudo curl -sS -L -o #{tmp_dir_dumm}/install.sh #{base_url} && sudo bash #{tmp_dir_dumm}/install.sh" context("version in prod") do mortar_install_env = ENV['MORTAR_INSTALL'] before(:each) do ENV['MORTAR_INSTALL'] = nil @@ -37,11 +37,10 @@ after(:all) do ENV['MORTAR_INSTALL'] = mortar_install_env end it "makes a curl request to download default version" do - mock(FileUtils).remove_entry_secure(tmp_dir_dumm) mock(Kernel).system (curl_command) any_instance_of(Mortar::Command::Version) do |base| mock(base).installed_with_omnibus? {true} mock(base).running_on_a_mac? {true} execute("version:upgrade"); @@ -49,12 +48,10 @@ end it "makes curl request for different versions when requested" do mortar_version = "1.0" curl_command_with_version = curl_command + " -v " + mortar_version - mock(FileUtils).remove_entry_secure(tmp_dir_dumm) - mock(FileUtils).remove_entry_secure(tmp_dir_dumm) mock(Kernel).system( curl_command_with_version) mock(Kernel).system( curl_command_with_version) any_instance_of(Mortar::Command::Version) do |base| mock(base).installed_with_omnibus? {true} mock(base).installed_with_omnibus? {true} @@ -67,18 +64,17 @@ end context("version dev") do dev_url = "dev_url.com" - dev_curl = "sudo curl -sS -L -o #{tmp_dir_dumm}/install.sh #{dev_url} && sudo bash #{tmp_dir_dumm}/install.sh" + dev_curl = "sudo mkdir -p #{tmp_dir_dumm} && sudo curl -sS -L -o #{tmp_dir_dumm}/install.sh #{dev_url} && sudo bash #{tmp_dir_dumm}/install.sh" before(:each) do ENV['MORTAR_INSTALL'] = dev_url end it "makes a curl request to download default version on dev" do mock(Kernel).system(dev_curl) - mock(FileUtils).remove_entry_secure(tmp_dir_dumm) any_instance_of(Mortar::Command::Version) do |base| mock(base).installed_with_omnibus? {true} mock(base).running_on_a_mac? {true} execute("upgrade"); end