Added tests for a minimumGit version of 1.8.0.

This commit is contained in:
Jeremy Cook
2014-11-23 22:22:44 -05:00
parent a808f56caf
commit 7bd9759e81
4 changed files with 24 additions and 12 deletions

View File

@@ -28,11 +28,11 @@ describe Homesick::CLI do
before do
# The following line suppresses Thor warnings about overriding methods.
allow($stdout).to receive(:write).at_least(:once)
expect_any_instance_of(Homesick::CLI).to receive(:`).and_return(Homesick::Actions::GitActions::STRING)
expect_any_instance_of(Homesick::Actions::GitActions).to receive(:`).and_return("git version #{Homesick::Actions::GitActions::STRING}")
end
it 'should not raise an exception when Git is installed' do
it 'should not raise an exception' do
output = Capture.stdout{ expect{Homesick::CLI.new}.not_to raise_error }
expect(output.chomp).not_to match(/#{Regexp.escape(Homesick::Actions::GitActions::STRING)}/)
expect(output.chomp).not_to include(Homesick::Actions::GitActions::STRING)
end
end
@@ -41,11 +41,11 @@ describe Homesick::CLI do
before do
# The following line suppresses Thor warnings about overriding methods.
allow($stdout).to receive(:write).at_least(:once)
expect_any_instance_of(Homesick::CLI).to receive(:`).and_return('')
expect_any_instance_of(Homesick::Actions::GitActions).to receive(:`).and_return("git version 1.0.0")
end
it 'should raise an exception when Git is not installed' do
it 'should raise an exception when' do
output = Capture.stdout{ expect{Homesick::CLI.new}.to raise_error SystemExit }
expect(output.chomp).to match(/#{Regexp.escape(Homesick::Actions::GitActions::STRING)}/)
expect(output.chomp).to include(Homesick::Actions::GitActions::STRING)
end
end
end