Permalink
Browse files

Add tests for extracting supported actions from commandline input

  • Loading branch information...
1 parent c8f6142 commit 55b83e525d3eb10c2e10d0753e618c6cd023b330 @Maher4Ever Maher4Ever committed Dec 20, 2011
Showing with 24 additions and 0 deletions.
  1. +24 −0 spec/guard/interactor_spec.rb
@@ -220,11 +220,35 @@ class Guard::FooBar < Guard::Guard;
end
describe 'extracting actions' do
+ it "returns :help action for the help entrie and for its shortcut" do
+ %w{help h}.each do |e|
+ subject.extract_scopes_and_action(e).should eql([{ }, :help])
+ end
+ end
+
+ it "returns :reload action for the reload entrie and for its shortcut" do
+ %w{reload r}.each do |e|
+ subject.extract_scopes_and_action(e).should eql([{ }, :reload])
+ end
+ end
+
it "returns :stop action for exit or quit entrie and for their shortcuts" do
%w{exit e quit q}.each do |e|
subject.extract_scopes_and_action(e).should eql([{ }, :stop])
end
end
+
+ it "returns :pause action for the pause entrie and for its shortcut" do
+ %w{pause p}.each do |e|
+ subject.extract_scopes_and_action(e).should eql([{ }, :pause])
+ end
+ end
+
+ it "returns :notification action for the notification entrie and for its shortcut" do
+ %w{notification n}.each do |e|
+ subject.extract_scopes_and_action(e).should eql([{ }, :notification])
+ end
+ end
end
end

0 comments on commit 55b83e5

Please sign in to comment.