diff options
| -rw-r--r-- | lib/nasty/composite_command.rb | 2 | ||||
| -rw-r--r-- | spec/unit/command_spec.rb | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/nasty/composite_command.rb b/lib/nasty/composite_command.rb index 6b0c683..a1f5a90 100644 --- a/lib/nasty/composite_command.rb +++ b/lib/nasty/composite_command.rb @@ -1,5 +1,7 @@ module Nasty class CompositeCommand + include Command + def initialize(first, last) @first = first @last = last diff --git a/spec/unit/command_spec.rb b/spec/unit/command_spec.rb index a3eddf1..fc041d4 100644 --- a/spec/unit/command_spec.rb +++ b/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 |
