Skip to content

Instantly share code, notes, and snippets.

@deependersingla
Created January 8, 2014 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deependersingla/8313967 to your computer and use it in GitHub Desktop.
Save deependersingla/8313967 to your computer and use it in GitHub Desktop.
Bundler.with_env helpers
Bundler.with_clean_env
should keep the original GEM_PATH even in sub processes
should not pass any bundler environment variables
should not pass RUBYOPT changes
should not change ORIGINAL_ENV
it should behave like Bundler.with_*_env
should reset and restore the environment
Bundler.with_original_env
should pass bundler environment variables set before Bundler was run
it should behave like Bundler.with_*_env
should reset and restore the environment
Bundler.clean_system
runs system inside with_clean_env
Bundler.clean_exec
runs exec inside with_clean_env
bundle update
with no arguments
updates the entire bundle
doesn't delete the Gemfile.lock file if something goes wrong
--quiet argument
shows UI messages without --quiet argument
does not show UI messages with --quiet argument
with a top level dependency
unlocks all child dependencies that are unrelated to other locked dependencies
with an unknown dependency
should inform the user
should suggest alternatives
with a child dependency
should update the child dependency
with --local option
doesn't hit repo2
with --group option
should update only specifed group gems
bundle update in more complicated situations
will eagerly unlock dependencies of a specified gem
bundle update without a Gemfile.lock
should not explode
bundle update when a gem depends on a newer version of bundler
should not explode
should explain that bundler conflicted
bundle update
shows the previous version of the gem when updated from rubygems source
bundle update
git sources
floats on a branch when :branch is used
updates correctly when you have like craziness
floats on a branch when :branch is used and the source is specified in the update
floats on master when updating all gems that are pinned to the source even if you have child dependencies
notices when you change the repo url in the Gemfile
fetches tags from the remote
errors with a message when the .git repo is gone
should not explode on invalid revision on update of gem by name
shows the previous version of the gem
with submodules
it unlocks the source when submodules are added to a git source
it unlocks the source when submodules are removed from git source (PENDING: This would require actually removing the submodule from the clone)
bundle update --source
git sources
updates the source
unlocks gems that were originally pulled in by the source
leaves all other gems frozen
shows the previous version of the gem when updated from path source
Pending:
bundle install with gem sources install time dependencies when some gems require a different version of ruby does not try to install those gems
# waiting for a rubygems index that includes ruby version
#
bundle update git sources with submodules it unlocks the source when submodules are removed from git source
# This would require actually removing the submodule from the clone
# ./spec/update/git_spec.rb:160
Finished in 23 minutes 25 seconds
915 examples, 0 failures, 2 pending
spec ran for 0.000000 0.030000 635.200000 (1836.415180)
deepender@deepender-Vostro-1450:~/bundler$ rspec spec/bundler/cli_rspec.rb
/home/deepender/bundler/lib/bundler/constants.rb:2: warning: already initialized constant Bundler::WINDOWS
/home/deepender/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:67: warning: previous definition of WINDOWS was here
/home/deepender/bundler/lib/bundler/constants.rb:3: warning: already initialized constant Bundler::FREEBSD
/home/deepender/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:68: warning: previous definition of FREEBSD was here
/home/deepender/bundler/lib/bundler/constants.rb:4: warning: already initialized constant Bundler::NULL
/home/deepender/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:69: warning: previous definition of NULL was here
Run options:
include {:focused=>true}
exclude {:ruby=>"1.8", :realworld=>true, :sudo=>true}
All examples were filtered out; ignoring {:focused=>true}
bundle executable
returns non-zero exit status when passed unrecognized options (FAILED - 1)
returns non-zero exit status when passed unrecognized task (FAILED - 2)
Failures:
1) bundle executable returns non-zero exit status when passed unrecognized options
Failure/Error: Unable to find matching line from backtrace
ArgumentError:
wrong number of arguments (2 for 1)
# ./spec/support/builders.rb:614:in `block in _build'
# ./spec/support/builders.rb:606:in `chdir'
# ./spec/support/builders.rb:606:in `_build'
# ./spec/support/builders.rb:366:in `block in build_with'
# ./spec/support/builders.rb:360:in `each'
# ./spec/support/builders.rb:360:in `build_with'
# ./spec/support/builders.rb:335:in `build_gem'
# ./spec/support/builders.rb:19:in `block in build_repo1'
# ./spec/support/builders.rb:302:in `update_repo'
# ./spec/support/builders.rb:297:in `build_repo'
# ./spec/support/builders.rb:18:in `build_repo1'
2) bundle executable returns non-zero exit status when passed unrecognized task
Failure/Error: Unable to find matching line from backtrace
ArgumentError:
wrong number of arguments (2 for 1)
# ./spec/support/builders.rb:614:in `block in _build'
# ./spec/support/builders.rb:606:in `chdir'
# ./spec/support/builders.rb:606:in `_build'
# ./spec/support/builders.rb:366:in `block in build_with'
# ./spec/support/builders.rb:360:in `each'
# ./spec/support/builders.rb:360:in `build_with'
# ./spec/support/builders.rb:335:in `build_gem'
# ./spec/support/builders.rb:19:in `block in build_repo1'
# ./spec/support/builders.rb:302:in `update_repo'
# ./spec/support/builders.rb:297:in `build_repo'
# ./spec/support/builders.rb:18:in `build_repo1'
Finished in 0.43668 seconds
2 examples, 2 failures
Failed examples:
rspec ./spec/bundler/cli_rspec.rb:5 # bundle executable returns non-zero exit status when passed unrecognized options
rspec ./spec/bundler/cli_rspec.rb:10 # bundle executable returns non-zero exit status when passed unrecognized task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment