Add spec to ls command. When 'ls -M instance' is called, exception should be raised.

This commit is contained in:
yui-knk 2013-12-23 22:53:17 +09:00
parent 2bb5d64581
commit b12aa12ed1
1 changed files with 5 additions and 0 deletions

View File

@ -92,6 +92,11 @@ describe "ls" do
test.should.not.raise
end
it "should show error message when instance is given with -M option" do
error = lambda{ pry_eval("ls -M String.new") }.should.raise(Pry::CommandError)
error.message.should.match(/-M only makes sense with a Module or a Class/)
end
# see: https://travis-ci.org/pry/pry/jobs/5071918
unless Pry::Helpers::BaseHelpers.rbx?