Permalink
Browse files

Merge pull request #635 from kyrylo/extend-command-group-regexp

Refactor tests for command groups
  • Loading branch information...
2 parents c3e38a3 + caeb6b5 commit 5964326f53a3820ff024b8743568d7d446881f3b @banister banister committed Jul 7, 2012
Showing with 14 additions and 6 deletions.
  1. +14 −6 test/test_command.rb
View
@@ -696,17 +696,25 @@ def process
describe 'group' do
before do
- @set.import Pry::DefaultCommands::Cd
+ @set.import(
+ Pry::CommandSet.new do
+ create_command("magic") { group("Not for a public use") }
+ end
+ )
+ end
+
+ it 'should be correct for default commands' do
+ @set.commands["help"].group.should == "Help"
end
it 'should not change once it is initialized' do
- @set.commands["cd"].group("-==CD COMMAND==-")
- @set.commands["cd"].group.should == "Context"
+ @set.commands["magic"].group("-==CD COMMAND==-")
+ @set.commands["magic"].group.should == "Not for a public use"
end
- it 'should be correct for default commands' do
- @set.commands["cd"].group.should == "Context"
- @set.commands["help"].group.should == "Help"
+ it 'should not disappear after the call without parameters' do
+ @set.commands["magic"].group
+ @set.commands["magic"].group.should == "Not for a public use"
end
end
end

0 comments on commit 5964326

Please sign in to comment.