Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Fix --no-coc and --no-mit flags #4148

Closed
wants to merge 1 commit into from
Closed

Fix --no-coc and --no-mit flags #4148

wants to merge 1 commit into from

Conversation

RochesterinNYC
Copy link
Contributor

  • Behavior for the gem command should be that utilizing these flags (or
    the --coc and --mit flags) overrides the defaults you have set in your
    bundler config settings for that one-off execution of the gem command
  • Added test coverage for testing --coc, --mit, --no-coc, --no-mit flags
    against bundle config settings
  • Refactored and DRYed up newgem_spec

Addresses #4094

@indirect
Copy link
Member

Ahh, great, thanks!

@RochesterinNYC
Copy link
Contributor Author

@indirect Hm, so regarding the broken Travis build, I saw this kind of stalled/frozen behavior locally while experimenting with different ways to call and use RSpec shared_examples. I'm guessing some of those build jobs (the ones using Ruby 1.8.7) are using older versions of RSpec and might not have support for the shared_example behavior I'm using in the spec. How would you recommend I proceed on this?

I could drop the use of RSpec shared examples but the coverage specs I added would be relatively lengthy and repetitive without them. I could also look more into the legacy RSpec those Ruby 1.8.7 builds are using? How do I find out which version of RSpec those are using? Thanks for your help!

@indirect
Copy link
Member

@RochesterinNYC we're using the same version of RSpec in all builds, as far as I know, installed with gem install rspec -v "~> 3.0". I'm perfectly happy with your tests only being called on only one of the gem names.

- Behavior for the `gem` command should be that utilizing these flags (or
  the `--coc` and `--mit` flags) overrides the defaults you have set in your
  bundler config settings for that one-off execution of the gem command
- Added test coverage for testing `--coc`, `--mit`, `--no-coc`, `--no-mit` flags
  against bundle config settings
- Refactored and DRYed up `newgem_spec`
@RochesterinNYC
Copy link
Contributor Author

@indirect Fixed the integration on the Ruby 1.8.7 builds without having to remove any test coverage. It seems the error was with Ruby 1.8.7 and setting only partial settings of the global config instead of all three main ones?

Setting all three like so in the before blocks:

global_config "BUNDLE_GEM__MIT" => "true", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false"

Rather than:

global_config "BUNDLE_GEM__MIT" => "true""

fixed it in the Ruby 1.8.7 builds. Can't say I know exactly why this was happening though.

@indirect
Copy link
Member

Awesome, thanks!

@indirect
Copy link
Member

Cherry-picked to the 1-11-stable branch as 6c18c55. This will be released in 1.11.1.

@indirect indirect closed this Dec 14, 2015
@RochesterinNYC
Copy link
Contributor Author

Great, thanks!

@RochesterinNYC RochesterinNYC deleted the fix--no-coc-and--no-mit-flags branch February 25, 2016 00:17
@RochesterinNYC RochesterinNYC restored the fix--no-coc-and--no-mit-flags branch February 25, 2016 00:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants