diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-02-03 14:35:50 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-02-03 14:35:50 -0800 |
commit | df759836fc561bf2136c849e11e9e50b00a62e3e (patch) | |
tree | c081318cba61f9836cfd06c7ea3d28583bfc4faf | |
parent | 739c0f3ab5de7d2cd5a0008b240259e6bd18fb51 (diff) | |
download | bundler-df759836fc561bf2136c849e11e9e50b00a62e3e.tar.gz |
Fix the specs (should probably run them before committing)
-rw-r--r-- | bundler.gemspec | 2 | ||||
-rw-r--r-- | spec/install/gems_spec.rb | 24 | ||||
-rw-r--r-- | spec/support/matchers.rb | 8 |
3 files changed, 11 insertions, 23 deletions
diff --git a/bundler.gemspec b/bundler.gemspec index f0605560fe..11eb386b7a 100644 --- a/bundler.gemspec +++ b/bundler.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |s| s.default_executable = %q{bundle} s.email = ["carlhuda@engineyard.com"] s.executables = ["bundle"] - s.files = ["bin/bundle", "lib/bundler/cli.rb", "lib/bundler/definition.rb", "lib/bundler/dependency.rb", "lib/bundler/dsl.rb", "lib/bundler/environment.rb", "lib/bundler/index.rb", "lib/bundler/installer.rb", "lib/bundler/remote_specification.rb", "lib/bundler/resolver.rb", "lib/bundler/rubygems.rb", "lib/bundler/settings.rb", "lib/bundler/setup.rb", "lib/bundler/source.rb", "lib/bundler/specification.rb", "lib/bundler/templates/environment.erb", "lib/bundler/templates/Gemfile", "lib/bundler/ui.rb", "lib/bundler/vendor/thor/actions/create_file.rb", "lib/bundler/vendor/thor/actions/directory.rb", "lib/bundler/vendor/thor/actions/empty_directory.rb", "lib/bundler/vendor/thor/actions/file_manipulation.rb", "lib/bundler/vendor/thor/actions/inject_into_file.rb", "lib/bundler/vendor/thor/actions.rb", "lib/bundler/vendor/thor/base.rb", "lib/bundler/vendor/thor/core_ext/file_binary_read.rb", "lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb", "lib/bundler/vendor/thor/core_ext/ordered_hash.rb", "lib/bundler/vendor/thor/error.rb", "lib/bundler/vendor/thor/group.rb", "lib/bundler/vendor/thor/invocation.rb", "lib/bundler/vendor/thor/parser/argument.rb", "lib/bundler/vendor/thor/parser/arguments.rb", "lib/bundler/vendor/thor/parser/option.rb", "lib/bundler/vendor/thor/parser/options.rb", "lib/bundler/vendor/thor/parser.rb", "lib/bundler/vendor/thor/rake_compat.rb", "lib/bundler/vendor/thor/runner.rb", "lib/bundler/vendor/thor/shell/basic.rb", "lib/bundler/vendor/thor/shell/color.rb", "lib/bundler/vendor/thor/shell.rb", "lib/bundler/vendor/thor/task.rb", "lib/bundler/vendor/thor/util.rb", "lib/bundler/vendor/thor/version.rb", "lib/bundler/vendor/thor.rb", "lib/bundler.rb", "LICENSE", "README.markdown"] + s.files = ["bin/bundle", "lib/bundler", "lib/bundler/cli.rb", "lib/bundler/definition.rb", "lib/bundler/dependency.rb", "lib/bundler/dsl.rb", "lib/bundler/environment.rb", "lib/bundler/index.rb", "lib/bundler/installer.rb", "lib/bundler/remote_specification.rb", "lib/bundler/resolver.rb", "lib/bundler/rubygems.rb", "lib/bundler/settings.rb", "lib/bundler/setup.rb", "lib/bundler/source.rb", "lib/bundler/specification.rb", "lib/bundler/templates", "lib/bundler/templates/environment.erb", "lib/bundler/templates/Gemfile", "lib/bundler/ui.rb", "lib/bundler/vendor", "lib/bundler/vendor/thor", "lib/bundler/vendor/thor/actions", "lib/bundler/vendor/thor/actions/create_file.rb", "lib/bundler/vendor/thor/actions/directory.rb", "lib/bundler/vendor/thor/actions/empty_directory.rb", "lib/bundler/vendor/thor/actions/file_manipulation.rb", "lib/bundler/vendor/thor/actions/inject_into_file.rb", "lib/bundler/vendor/thor/actions.rb", "lib/bundler/vendor/thor/base.rb", "lib/bundler/vendor/thor/core_ext", "lib/bundler/vendor/thor/core_ext/file_binary_read.rb", "lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb", "lib/bundler/vendor/thor/core_ext/ordered_hash.rb", "lib/bundler/vendor/thor/error.rb", "lib/bundler/vendor/thor/group.rb", "lib/bundler/vendor/thor/invocation.rb", "lib/bundler/vendor/thor/parser", "lib/bundler/vendor/thor/parser/argument.rb", "lib/bundler/vendor/thor/parser/arguments.rb", "lib/bundler/vendor/thor/parser/option.rb", "lib/bundler/vendor/thor/parser/options.rb", "lib/bundler/vendor/thor/parser.rb", "lib/bundler/vendor/thor/rake_compat.rb", "lib/bundler/vendor/thor/runner.rb", "lib/bundler/vendor/thor/shell", "lib/bundler/vendor/thor/shell/basic.rb", "lib/bundler/vendor/thor/shell/color.rb", "lib/bundler/vendor/thor/shell.rb", "lib/bundler/vendor/thor/task.rb", "lib/bundler/vendor/thor/util.rb", "lib/bundler/vendor/thor/version.rb", "lib/bundler/vendor/thor.rb", "lib/bundler.rb", "LICENSE", "README.markdown"] s.homepage = %q{http://github.com/carlhuda/bundler} s.require_paths = ["lib"] s.rubygems_version = %q{1.3.5} diff --git a/spec/install/gems_spec.rb b/spec/install/gems_spec.rb index 6d8fe8a182..ef3a263603 100644 --- a/spec/install/gems_spec.rb +++ b/spec/install/gems_spec.rb @@ -246,17 +246,11 @@ describe "gemfile install with gem sources" do end it "installs gems in the default group" do - out = ruby <<-G - begin ; require 'rubygems' ; require 'rack' ; puts "WIN" ; end - G - out.should == "WIN" + should_be_installed "rack 1.0.0" end it "installs gems in other groups" do - out = ruby <<-G - begin ; require 'rubygems' ; require 'activesupport' ; puts "WIN" ; end - G - out.should == "WIN" + should_be_installed "activesupport 2.3.5" end it "sets up everything if Bundler.setup is used with no groups" do @@ -280,21 +274,11 @@ describe "gemfile install with gem sources" do end it "installs gems in the default group" do - out = ruby <<-G - begin ; require 'rubygems' ; require 'rack' ; puts "WIN" ; end - G - out.should == "WIN" + should_be_installed "rack 1.0.0", :groups => [:default] end it "does not install gems from the excluded group" do - out = ruby <<-G - begin ; require 'rubygems' ; require 'activesupport' - rescue LoadError - puts "WIN" - end - G - - out.should == 'WIN' + should_not_be_installed "activesupport 2.3.5", :groups => [:default] end it "allows Bundler.setup for specific groups" do diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index bb132510df..5e28ac7777 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -16,9 +16,11 @@ module Spec end def should_be_installed(*names) + opts = names.last.is_a?(Hash) ? names.pop : {} + groups = opts[:groups] || [] names.each do |name| name, version = name.split(/\s+/) - run "require '#{name}'; puts #{Spec::Builders.constantize(name)}" + run "require '#{name}'; puts #{Spec::Builders.constantize(name)}", *groups Gem::Version.new(out).should == Gem::Version.new(version) end end @@ -26,9 +28,11 @@ module Spec alias should_be_available should_be_installed def should_not_be_installed(*names) + opts = names.last.is_a?(Hash) ? names.pop : {} + groups = opts[:groups] || [] names.each do |name| name, version = name.split(/\s+/) - run <<-R + run <<-R, *groups begin require '#{name}' puts #{Spec::Builders.constantize(name)} |