Commit f6b096a
Changed files (2)
lib
nasty
spec
unit
lib/nasty/composite_command.rb
@@ -1,5 +1,7 @@
module Nasty
class CompositeCommand
+ include Command
+
def initialize(first, last)
@first = first
@last = last
spec/unit/command_spec.rb
@@ -20,12 +20,13 @@ module Nasty
context "without parameters" do
let(:first_command) { SimpleCommand.new }
let(:second_command) { SimpleCommand.new }
+ let(:third_command) { SimpleCommand.new }
- it "chains two commands together" do
- result = first_command.then(second_command)
- result.run
+ it "chains multiple commands together" do
+ first_command.then(second_command).then(third_command).run
first_command.ran?.should be_true
second_command.ran?.should be_true
+ third_command.ran?.should be_true
end
end