diff options
author | Andre Arko <andre@arko.net> | 2013-07-24 23:15:29 -0700 |
---|---|---|
committer | Jessica Lynn Suttles <jlsuttles@gmail.com> | 2013-08-05 14:15:50 -0700 |
commit | 0750d45b3933a5d1f28ebf4494c8505739a3a827 (patch) | |
tree | cf42596c66c2494271f552609d5f6b06fe5a97bf /spec/commands/console_spec.rb | |
parent | 4a53681628b895c7d0d372269ffd556d78763826 (diff) | |
download | bundler-0750d45b3933a5d1f28ebf4494c8505739a3a827.tar.gz |
break out cli command specs into a dedicated dir
move the dispatch integration specs into other
load friendly_errors so we can unit test it
require Thor so we can rescue the errors
bump ArgumentError above Exception so it wins
Diffstat (limited to 'spec/commands/console_spec.rb')
-rw-r--r-- | spec/commands/console_spec.rb | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/spec/commands/console_spec.rb b/spec/commands/console_spec.rb new file mode 100644 index 0000000000..b72883a01c --- /dev/null +++ b/spec/commands/console_spec.rb @@ -0,0 +1,54 @@ +require "spec_helper" + +describe "bundle console" do + before :each do + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "rack" + gem "activesupport", :group => :test + gem "rack_middleware", :group => :development + G + end + + it "starts IRB with the default group loaded" do + bundle "console" do |input| + input.puts("puts RACK") + input.puts("exit") + end + expect(out).to include("0.9.1") + end + + it "doesn't load any other groups" do + bundle "console" do |input| + input.puts("puts ACTIVESUPPORT") + input.puts("exit") + end + expect(out).to include("NameError") + end + + describe "when given a group" do + it "loads the given group" do + bundle "console test" do |input| + input.puts("puts ACTIVESUPPORT") + input.puts("exit") + end + expect(out).to include("2.3.5") + end + + it "loads the default group" do + bundle "console test" do |input| + input.puts("puts RACK") + input.puts("exit") + end + expect(out).to include("0.9.1") + end + + it "doesn't load other groups" do + bundle "console test" do |input| + input.puts("puts RACK_MIDDLEWARE") + input.puts("exit") + end + expect(out).to include("NameError") + end + end +end |