spec/lib/capistrano/dsl/task_enhancements_spec.rb in capistrano-3.11.0 vs spec/lib/capistrano/dsl/task_enhancements_spec.rb in capistrano-3.11.1

- old
+ new

@@ -33,29 +33,29 @@ Rake::Task.define_task("after_task") do order.push "after_task" end end - it "invokes in proper order if define after than before" do + it "invokes in proper order if define after than before", capture_io: true do task_enhancements.after("task", "after_task") task_enhancements.before("task", "before_task") Rake::Task["task"].invoke order expect(order).to eq(%w(before_task task after_task)) end - it "invokes in proper order if define before than after" do + it "invokes in proper order if define before than after", capture_io: true do task_enhancements.before("task", "before_task") task_enhancements.after("task", "after_task") Rake::Task["task"].invoke order expect(order).to eq(%w(before_task task after_task)) end - it "invokes in proper order when referring to as-yet undefined tasks" do + it "invokes in proper order when referring to as-yet undefined tasks", capture_io: true do task_enhancements.after("task", "not_loaded_task") Rake::Task.define_task("not_loaded_task") do order.push "not_loaded_task" end @@ -63,11 +63,11 @@ Rake::Task["task"].invoke order expect(order).to eq(%w(task not_loaded_task)) end - it "invokes in proper order and with arguments and block" do + it "invokes in proper order and with arguments and block", capture_io: true do task_enhancements.after("task", "after_task_custom", :order) do |_t, _args| order.push "after_task" end task_enhancements.before("task", "before_task_custom", :order) do |_t, _args| @@ -77,11 +77,11 @@ Rake::Task["task"].invoke(order) expect(order).to eq(%w(before_task task after_task)) end - it "invokes using the correct namespace when defined within a namespace" do + it "invokes using the correct namespace when defined within a namespace", capture_io: true do Rake.application.in_namespace("namespace") do Rake::Task.define_task("task") do |t| order.push(t.name) end task_enhancements.before("task", "before_task", :order) do |t| @@ -97,10 +97,10 @@ expect(order).to eq( ["namespace:before_task", "namespace:task", "namespace:after_task"] ) end - it "raises a sensible error if the task isn't found" do + it "raises a sensible error if the task isn't found", capture_io: true do task_enhancements.after("task", "non_existent_task") expect { Rake::Task["task"].invoke order }.to raise_error(ArgumentError, 'Task "non_existent_task" not found') end end end