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

Pessimistic test framework versions for bundle gem command #3811

Closed
wants to merge 1 commit into from

Conversation

tf
Copy link
Contributor

@tf tf commented Jul 5, 2015

Here's a first draft of the change discussed in #3806.

Use a pessimistic version requirement for RSpec and Minitest in
gemspecs generated by the bundle gem command. It is best practice to
at least depend on major versions of development dependency gems.

  • Hard code major versions of the two testing frameworks.
  • Add a spec that tests that only specific version requirements are
    used in development dependencies.

Some questions:

  • The test forbundle gem contains some duplication for cases concerning different gem names (with dash, with underscore etc). The shared example group that I added could have been used in more of the nested contexts, but I did not feel that those were testing different paths in my case.
  • I mostly struggled with the naming of the shared example group. Probably someone could come up with something a little less stilted...

Looking forward to your feedback.

Use a pessimistic version requirement for RSpec and Minitest in
gemspecs generated by the `bundle gem` command. It is best practice to
at least depend on major versions of development dependency gems.

* Hard code major versions of the two testing frameworks.
* Add a spec that tests that only specific version requirements are
  used in development dependencies.
@tf
Copy link
Contributor Author

tf commented Jul 6, 2015

Not sure why the specs are failing for Rubygems < 2.0. remove_push_guard seems to be called in the before block. Shouldn't that prevent the error?

@indirect
Copy link
Member

A couple of reasons... the guard removal code wasn't actually being called where you inserted the test, and the specific? method only exists on RubyGems 1.8.1 and higher. I pushed a commit with fixed tests to #3885.

@indirect indirect closed this Jul 27, 2015
@tf
Copy link
Contributor Author

tf commented Jul 27, 2015

Thanks! 👍

@tf tf deleted the newgem-test-framework-versions branch July 27, 2015 18:43
homu added a commit that referenced this pull request Jul 27, 2015
Depend on major version of test gems

Use a pessimistic version requirement for RSpec and Minitest in
gemspecs generated by the bundle gem command. It is best practice to
at least depend on major versions of development dependency gems.

refs #3811
homu added a commit that referenced this pull request Jul 28, 2015
Depend on major version of test gems

Use a pessimistic version requirement for RSpec and Minitest in
gemspecs generated by the bundle gem command. It is best practice to
at least depend on major versions of development dependency gems.

refs #3811
@indirect
Copy link
Member

Merged in 26c4665. Thanks for the feature!

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