spec/command-task.rb in mattock-0.3.1 vs spec/command-task.rb in mattock-0.3.2
- old
+ new
@@ -1,11 +1,14 @@
require 'mattock/remote-command-task'
+require 'mattock/bundle-command-task'
require 'mattock/testing/rake-example-group'
require 'mattock/testing/mock-command-line'
describe Mattock::RemoteCommandTask do
include Mattock::RakeExampleGroup
+ include Mattock::CommandLineExampleGroup
+
let! :remote_task do
namespace :test do
Mattock::RemoteCommandTask.new do |t|
t.remote_server.address = "nowhere.com"
t.command = Mattock::PrereqChain.new do |prereq|
@@ -23,15 +26,29 @@
end
end
end
describe "when verification indicates command should proceed" do
- include Mattock::CommandLineExampleGroup
-
it "should run both commands" do
expect_command(/should_do/, 1)
expect_command(/^ssh.*cd.*ls.*grep.*rubyfiles.txt/, 0)
rake["test:run"].invoke
end
+ end
+end
+
+describe Mattock::BundleCommandTask do
+ include Mattock::RakeExampleGroup
+ include Mattock::CommandLineExampleGroup
+
+ let! :bundle_task do
+ Mattock::BundleCommandTask.new(:bundle_test) do |t|
+ t.command = cmd("bundle", "install", "--standalone")
+ end
+ end
+
+ it "should run command" do
+ expect_command(/bundle install/, 0)
+ rake["bundle_test"].invoke
end
end