-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate support for Ruby versions earlier than v2.0
This is long overdue. Extended maintenance of Ruby v1.9.3 ended on 23 Feb 2015 [1]. Actually dropping support will allow significant simplification of the code. The immediate motivation is to come up with better parameter matching for keyword arguments and we've run into parsing issues when trying to do this in conjunction with continuing to support Ruby v1.9. Requiring 'mocha/ruby_version' from 'mocha/test_unit', 'mocha/minitest' and 'mocha/api' is intended to ensure the deprecation warning appears at the earliest possible time whether the library is being used via Test::Unit, Minitest or RSpec. See #325. [1]: https://www.ruby-lang.org/en/news/2014/01/10/ruby-1-9-3-will-end-on-2015/
- Loading branch information
1 parent
6a09a37
commit d752f09
Showing
4 changed files
with
11 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
require 'mocha/ruby_version' | ||
require 'mocha/parameter_matchers' | ||
require 'mocha/hooks' | ||
require 'mocha/mockery' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
require 'mocha/ruby_version' | ||
require 'mocha/integration/mini_test' | ||
require 'mocha/deprecation' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
require 'mocha/deprecation' | ||
|
||
module Mocha | ||
RUBY_V2_PLUS = Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2') | ||
|
||
unless RUBY_V2_PLUS | ||
Mocha::Deprecation.warning( | ||
'Versions of Ruby earlier than v2.0 will not be supported in future versions of Mocha.' | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
require 'mocha/ruby_version' | ||
require 'mocha/integration/test_unit' | ||
require 'mocha/deprecation' | ||
|
||
|