Convert Reinstall test to spec.

This commit is contained in:
Markus Reiter 2017-02-08 13:29:46 +01:00
parent 7b2d8ed4b3
commit 20b77dfdcc
2 changed files with 24 additions and 24 deletions

View File

@ -0,0 +1,24 @@
require "spec_helper"
describe Hbc::CLI::Reinstall do
it "allows reinstalling a Cask" do
shutup do
Hbc::CLI::Install.run("local-transmission")
end
expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed
shutup do
Hbc::CLI::Reinstall.run("local-transmission")
end
expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed
end
it "allows reinstalling a non installed Cask" do
expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).not_to be_installed
shutup do
Hbc::CLI::Reinstall.run("local-transmission")
end
expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed
end
end

View File

@ -1,24 +0,0 @@
require "test_helper"
describe Hbc::CLI::Reinstall do
it "allows reinstalling a Cask" do
shutup do
Hbc::CLI::Install.run("local-transmission")
end
Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb").must_be :installed?
shutup do
Hbc::CLI::Reinstall.run("local-transmission")
end
Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb").must_be :installed?
end
it "allows reinstalling a non installed Cask" do
Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb").wont_be :installed?
shutup do
Hbc::CLI::Reinstall.run("local-transmission")
end
Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb").must_be :installed?
end
end