Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
dca9c4e
Update rubocop TODO list
floehopper Dec 22, 2024
c2b5c3f
Improve docs for cardinality-related methods
floehopper Dec 22, 2024
93d4573
Improvements to docs for Expectation#times
floehopper Dec 22, 2024
9289927
Merge pull request #700 from freerange/improvements-to-docs-for-cardi…
floehopper Dec 22, 2024
d65adad
Introduce Expectation#thrice
andrewn617 Dec 19, 2024
d1274b3
Merge pull request #701 from freerange/add-expectation-thrice
floehopper Dec 22, 2024
c8e8160
Drop support for Ruby v2.1
floehopper Dec 7, 2024
4428776
Merge pull request #695 from freerange/drop-support-for-ruby-v2.1
floehopper Dec 22, 2024
265d6eb
Extract gemspec description into constant
floehopper Dec 24, 2024
4840360
Split gemspec description into multiple lines
floehopper Dec 24, 2024
cc9221e
Improve gemspec description
floehopper Dec 7, 2024
1fcdb2f
Merge pull request #696 from freerange/update-gemspec-description
floehopper Dec 24, 2024
8c49314
Add base64 to Gemfile to avoid Ruby v3.3 warning
floehopper Dec 24, 2024
a76330d
Only add base64 to Gemfile for Ruby >= v3.3.0
floehopper Dec 24, 2024
04063f0
Include custom Gemfiles in rubocop linting
floehopper Dec 24, 2024
b212740
Use ruby:3.4.0-rc1 vs ruby:3.4.0-preview2 in CI
floehopper Dec 24, 2024
2b05e09
Add ostruct to Gemfile for Ruby >= v3.4.0
floehopper Dec 24, 2024
cfa9728
Add missing blank line in Gemfile
floehopper Dec 24, 2024
e7de937
Add Ruby v3.4 to CI build matrix
floehopper Dec 25, 2024
78f020e
Merge pull request #708 from freerange/add-ruby-v3.4-to-build-matrix
floehopper Dec 31, 2024
055ff7a
Fix Ruby v3.4 warnings in ObjectInspectTest
floehopper Dec 31, 2024
4cda7d6
Merge pull request #710 from freerange/fix-ruby-v3.4-warnings
floehopper Dec 31, 2024
c5843e4
Extract gemfiles/Gemfile.rubocop
floehopper Dec 24, 2024
b78c92b
Run rubocop linting on Ruby v3.3 in CI build
floehopper Dec 24, 2024
571daa1
Use latest rubocop for linting
floehopper Dec 24, 2024
e18b3f0
Opt in to new rubocop cops by default
floehopper Dec 24, 2024
2b88818
Auto-correct Gemspec/AddRuntimeDependency violation
floehopper Dec 24, 2024
ea957ee
Auto-correct Gemspec/RequireMFA violation
floehopper Dec 24, 2024
f988e6f
Auto-correct Layout/EmptyLineAfterGuardClause violations
floehopper Dec 24, 2024
dfc877b
Auto-correct Layout/EmptyLinesAroundAttributeAccessor violations
floehopper Dec 24, 2024
a9c403c
Auto-correct Lint/InheritException violation
floehopper Dec 24, 2024
13a4886
Auto-correct Lint/IdentityComparison violations
floehopper Dec 24, 2024
0fe6076
Auto-correct Style/ClassEqualityComparison violation
floehopper Dec 24, 2024
19c1ca8
Auto-correct Style/CombinableLoops violations
floehopper Dec 24, 2024
b1f9ff1
Auto-correct Style/ExplicitBlockArgument violation
floehopper Dec 24, 2024
ec3f2ab
Auto-correct Style/MutableConstant violations
floehopper Dec 24, 2024
a127b95
Auto-correct Style/RedundantRegexpEscape violations
floehopper Dec 24, 2024
5cf3b9a
Auto-correct Style/RedundantReturn violations
floehopper Dec 24, 2024
ca973d0
Auto-correct Style/StringConcatenation violations
floehopper Dec 24, 2024
236eae7
Move trailing slash out of lib directory string
floehopper Dec 24, 2024
8a10d2b
Re-genenerate rubocop to-do list
floehopper Dec 24, 2024
52e93ac
Use kwarg for optional boolean `instantiate` arg
floehopper Dec 24, 2024
1ea3d17
Use kwarg for optional boolean `include_public_methods` arg
floehopper Dec 24, 2024
51922ea
Use kwarg for optional boolean `wrapped` arg
floehopper Dec 24, 2024
54766b1
Use kwarg for optional boolean `satisfied` arg
floehopper Dec 24, 2024
1fb0ee3
Fix Style/RedundantDoubleSplatHashBraces violations
floehopper Dec 24, 2024
9c19b23
Allow one Lint/IdentityComparison violation
floehopper Jan 1, 2025
cc0fe38
Auto-correct Lint/SendWithMixinArgument violations
floehopper Jan 1, 2025
dabca51
Auto-correct Lint/SymbolConversion violations
floehopper Jan 1, 2025
8d428e0
Disable Lint/UselessTimes in tests
floehopper Jan 1, 2025
cac3e6c
Fix Lint/MissingSuper violations
floehopper Jan 1, 2025
d09d5ca
Disable Lint/EmptyClass in tests
floehopper Jan 1, 2025
92ec1c1
Disable Lint/EmptyBlock in tests
floehopper Jan 1, 2025
d4e37da
Fix Lint/SuppressedException violations
floehopper Jan 1, 2025
1d2c32c
Disable Naming/VariableNumber in tests
floehopper Jan 1, 2025
fddebc3
Allow some core Ruby methods to be overridden
floehopper Jan 1, 2025
d98375c
Disable Style/FetchEnvVar for env var in Rakefile
floehopper Jan 1, 2025
835caa2
Add rubocop-rake & fix Rake/Desc violations
floehopper Jan 1, 2025
cd34831
Merge pull request #705 from freerange/rubocop-improvements
floehopper Jan 1, 2025
eaf0349
Remove docs for `use_test_unit_gem` option
floehopper Jan 1, 2025
69ef41c
Correct docs for MOCHA_OPTIONS "debug" value
floehopper Jan 1, 2025
78a5d80
Use built-in Ruby debug option vs custom module
floehopper Jan 1, 2025
1207992
Merge pull request #715 from freerange/use-built-in-ruby-debug-option…
floehopper Jan 1, 2025
4fe8391
Consistently use development group in Gemfiles
floehopper Jan 1, 2025
2351af6
Merge pull request #716 from freerange/consistently-use-development-g…
floehopper Jan 1, 2025
6e53a35
Default strict kwarg matching to true in Ruby v3
floehopper Jan 1, 2025
984052c
Merge pull request #718 from freerange/set-strict-kwarg-matching-to-t…
floehopper Jan 1, 2025
7f99db6
Add missing requires for 'mocha/ruby_version'
floehopper Jan 1, 2025
9b75183
Use Ruby v1.9 Hash syntax in Hash#mocha_inspect
floehopper Jan 1, 2025
a04434f
Merge pull request #719 from freerange/use-ruby-v19-hash-syntax-in-ha…
floehopper Jan 1, 2025
62106cc
Improve #mocha_inspect for empty kwarg Hash
floehopper Jan 1, 2025
e6ea88f
Merge pull request #720 from freerange/improve-mocha-inspect-for-empt…
floehopper Jan 1, 2025
b5a89f5
Improve error if teardown called before setup
floehopper Jan 1, 2025
01809ba
Merge pull request #721 from freerange/improve-error-when-mockery-tea…
floehopper Jan 1, 2025
ec55fcb
Avoid mutating string literals
floehopper Jan 1, 2025
13c6109
Freeze string literals using magic comments
floehopper Jan 1, 2025
de4013e
Set enable-frozen-string-literal option in CI
floehopper Jan 1, 2025
1c5dda3
Merge pull request #722 from freerange/freeze-string-literals
floehopper Jan 1, 2025
a1a50bb
Convert ParameterMatchers::Base class -> module
floehopper Jan 1, 2025
b04143e
Merge pull request #723 from freerange/convert-parameter-matchers-bas…
floehopper Jan 1, 2025
c4501d2
Remove unused Mocha::Integration::Minitest.translate
floehopper Jan 2, 2025
b108f1e
Remove redundant 'lib/mocha/is_a.rb'
floehopper Jan 2, 2025
81e108a
Fix Mocha::BlockMatchers filename
floehopper Jan 2, 2025
9141d5c
Rename AcceptanceTest -> AcceptanceTestHelper
floehopper Jan 2, 2025
0b83f26
Fix MockedMethodDispatchTest filename
floehopper Jan 2, 2025
8b9c53a
Rename FailureMessageTest to match filename
floehopper Jan 2, 2025
2613c49
Rename OptionalParameterMatcherTest & filename
floehopper Jan 2, 2025
e395da1
Rename PartialMockTest -> PartialMocksTest
floehopper Jan 2, 2025
41af5b5
Fix PositionalAndKeywordHashInspectTest filename
floehopper Jan 2, 2025
680e282
Fix StubbingSameClassMethodOnParentAndChildClassTest filename
floehopper Jan 2, 2025
5a99dec
Rename MinitestResult -> MinitestResultPreV5
floehopper Jan 2, 2025
8f49311
Rename EquivalentUriMatchesTest -> EquivalentUriTest
floehopper Jan 2, 2025
50b2648
Rename Stub::Matcher -> StubMatcher
floehopper Jan 2, 2025
8da6a53
Split receivers test into file per test case
floehopper Jan 2, 2025
b22cabd
Split receivers into file per class
floehopper Jan 2, 2025
f4db70f
Split names into file per class
floehopper Jan 2, 2025
bdab10c
Remove redundant requires of 'mocha/ruby_version'
floehopper Jan 3, 2025
818b5c2
Define Mocha module in 'lib/mocha.rb'
floehopper Jan 3, 2025
e08c553
Enable stricter version of Naming/FileName cop
floehopper Jan 3, 2025
b1db3c4
Avoid having to add sub-directory to LOAD_PATH
floehopper Jan 3, 2025
c495cd1
Merge pull request #726 from freerange/enable-expect-matching-definit…
floehopper Jan 3, 2025
b90b371
Remove support for running tests w/ Minitest < v5
floehopper Jan 3, 2025
1a846c1
Simplify Minitest version logic in TestRunner
floehopper Jan 3, 2025
23d1735
Re-generate rubocop to-do list
floehopper Jan 3, 2025
9929ee0
Merge pull request #727 from freerange/remove-support-for-running-tes…
floehopper Jan 3, 2025
39d9995
Remove duplicate DefaultReceiverTest
floehopper Jan 3, 2025
0134f65
Remove argument splat in Deprecation.warning
floehopper Jan 3, 2025
ebea0dd
Improve deprecation warning capture in tests
floehopper Jan 3, 2025
da81e81
Move deprecation assertions outside inner test
floehopper Jan 3, 2025
cb45928
Extract last_deprecation_warning methods
floehopper Jan 3, 2025
44b1f86
Separate test cases in KeywordArgumentMatchingTest
floehopper Jan 3, 2025
eb84bcd
Configure strict/loose kwarg matching in setup
floehopper Jan 3, 2025
097446d
Move Ruby version check outside strict test case
floehopper Jan 3, 2025
5b2daae
Split kwarg matching tests into separate files
floehopper Jan 3, 2025
509849a
Extract assert_deprecation_warning method
floehopper Jan 3, 2025
c78baef
Split string literals more logically
floehopper Jan 3, 2025
b7919fd
Extract assert_deprecation_warning_location method
floehopper Jan 3, 2025
067f057
Merge pull request #730 from freerange/improvements-to-keyword-argume…
floehopper Jan 3, 2025
b282794
Split kwarg matcher test into three tests
floehopper Jan 4, 2025
942255f
Configure strict/loose kwarg matching in setup
floehopper Jan 4, 2025
302e918
Add missing require to kwarg matching tests
floehopper Jan 4, 2025
9bbeb32
Make kwarg matcher test more consistent
floehopper Jan 4, 2025
3c85cad
Merge pull request #731 from freerange/improvements-to-keyword-argume…
floehopper Jan 4, 2025
b37104b
Rename value in PositionalOrKeywordHash
floehopper Jan 4, 2025
16c7c51
Rename available_parameters in PositionalOrKeywordHash
floehopper Jan 4, 2025
a19bed1
Rename parameter in PositionalOrKeywordHash
floehopper Jan 4, 2025
6f51631
Check test passed before deprecation warning check
floehopper Jan 4, 2025
63d3854
Remove redundant test name suffixes
floehopper Jan 4, 2025
254cc73
Keyword args always match last positional hash
floehopper Jan 4, 2025
9999c9e
Move Ruby version check outside strict unit test
floehopper Jan 4, 2025
8e330a0
Extract PositionalOrKeywordHash#matches_last_actual_value?
floehopper Jan 24, 2025
7f5970f
Use if/else in PositionalOrKeywordHash#matches_last_actual_value?
floehopper Jan 24, 2025
68df587
Use elsif's in PositionalOrKeywordHash#matches_last_actual_value?
floehopper Jan 24, 2025
e53c246
Extract KeywordOrPositionalHash#last_expected_value_is_positional_hash?
floehopper Jan 24, 2025
c724f29
Use elsif's in PositionalOrKeywordHash#matches?
floehopper Jan 24, 2025
ca39d5b
Extract PositionalOrKeywordHash#matches_entries_exactly?
floehopper Jan 24, 2025
07850d3
Fix Style/RedundantReturn violations
floehopper Jan 24, 2025
54a49c0
Disable Lint/DuplicateBranch on one line
floehopper Jan 24, 2025
a792b53
Merge pull request #732 from freerange/allow-keyword-arguments-to-be-…
floehopper Jan 24, 2025
73b0e9a
Bump version to 3.0.0-rc.1 & prepare for release
floehopper Jan 24, 2025
09a5d9b
[skip ci] Update documentation for v3.0.0-rc.1
floehopper Jan 24, 2025
dfebb03
Remove workaround for JRuby jar-dependencies issue
floehopper Jan 30, 2025
0d16170
Merge pull request #737 from freerange/remove-workaround-for-jruby-ja…
floehopper Jan 30, 2025
c913081
add benchmark to Gemfile to fix warning
nitishr Feb 17, 2025
d07e12e
Merge pull request #740 from nitishr/fix-benchmark-related-warning
floehopper Feb 17, 2025
08852f0
Fix formatting in .circleci/config.yml
floehopper Feb 22, 2025
9f08b75
add documentation coverage check
nitishr Feb 21, 2025
f7d3f3f
documentation to raise coverage to 100%
nitishr Feb 21, 2025
1d919d9
increase docs coverage threshold to 100%
nitishr Feb 21, 2025
544b979
check docs coverage in CI build
nitishr Feb 21, 2025
ba0d53b
Move original docs rake tasks into docs namespace
floehopper Feb 24, 2025
0336225
Merge pull request #745 from freerange/add-documentation-coverage-check
floehopper Feb 24, 2025
a93393a
fix: cop Lint/LiteralAsCondition warning
nitishr Feb 26, 2025
93f6274
Merge pull request #746 from nitishr/Lint/LiteralAsCondition
floehopper Feb 26, 2025
ee0f379
Fix rdoc-related warning when running doc rake task
floehopper Feb 26, 2025
c04160d
Merge pull request #747 from freerange/fix-rdoc-related-warning
floehopper Feb 26, 2025
c37c574
ruby2.2 has no frozen-string-literal
nitishr Feb 18, 2025
d0fa544
remove unused variable - execution_point
nitishr Feb 18, 2025
f566f67
fix:instance var @logger not initialized
nitishr Feb 18, 2025
b578fdc
prep: ignore jruby alias_method warning
nitishr Feb 25, 2025
3dad219
ignore jruby alias_method method warning
nitishr Feb 18, 2025
7e94d3f
DRY up ignoring_warning
nitishr Feb 25, 2025
a817a96
fail fast on warnings in build pipeline
nitishr Feb 18, 2025
cfa9a74
Merge pull request #741 from nitishr/fail-fast-on-any-ruby-warnings
floehopper Feb 26, 2025
fbf023d
rename: respond_to? ->stubba_respond_to?
nitishr Feb 20, 2025
fb6453e
separate rubocop configuration for tests
nitishr Feb 20, 2025
7ff2f37
override respond_to_missing? in fixtures
nitishr Feb 24, 2025
6d9947d
Merge pull request #750 from freerange/dont-override-respond_to
floehopper Mar 1, 2025
0813986
stubbee -> stubba_object, mock_owner -> stubbee
nitishr Jan 17, 2020
c482564
Merge pull request #751 from freerange/stubee-mock-owner-naming
floehopper Mar 1, 2025
26212bd
grep output directly without a temp file
nitishr Mar 1, 2025
d1d4b82
make RUBYOPT available to all run steps
nitishr Feb 27, 2025
cd05da1
Merge pull request #752 from nitishr/fail-fast-on-doc-gen-warning
floehopper Mar 1, 2025
8a6ed94
Refactor: delegate cardinality updates to times
nitishr Mar 16, 2020
00b4cac
make Cardinality#times similar to initializer
nitishr Mar 17, 2020
977c609
replace Cardinality#times with Cardinality#update
nitishr Mar 17, 2020
8b9ecc7
Refactor: rename Cardinality#update to range
nitishr Mar 17, 2020
c3d241b
Refactor: inline exactly, at_{least,most}
nitishr Mar 17, 2020
d620bac
Refactor:simplify Expectation#times implementation
nitishr Mar 17, 2020
87b84ea
Refactor: rename Cardinality#count to times
nitishr Mar 17, 2020
4ffa826
document cardinality methods equivalence
nitishr Feb 26, 2025
0a7890e
range more intention revealing than new
nitishr Feb 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 30 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
version: 2.1

commands:
run-fail-fast:
description: "Execute command and fail on any warning in output"
parameters:
command:
type: string
steps:
- run: << parameters.command >> 2>&1 | tee >(grep -q "warning:" && exit 1)
jobs:
build:
parameters:
Expand All @@ -9,58 +17,65 @@ jobs:
type: string
docker:
- image: << parameters.docker-image >>
environment:
MOCHA_OPTIONS=debug
steps:
- checkout
- run: ruby --version
- when:
condition:
equal: [ "jruby:latest", << parameters.docker-image >>]
equal: ["jruby:latest", << parameters.docker-image >>]
steps:
- run: apt-get update
- run: apt-get install -y git
- run: gem --version
- run: bundle --version
- run: bundle install --gemfile=<< parameters.gemfile >>
- unless:
condition:
equal: ["ruby:2.2", << parameters.docker-image >>]
steps:
- run: echo 'export RUBYOPT="--enable-frozen-string-literal"' >> "$BASH_ENV"
- when:
condition:
equal: [ "Gemfile", << parameters.gemfile >>]
equal: ["Gemfile", << parameters.gemfile >>]
steps:
- run: bundle exec rake test
- run-fail-fast:
command: bundle exec rake test
- when:
condition:
matches:
pattern: ".*minitest.*"
value: << parameters.gemfile >>
steps:
- run: MOCHA_RUN_INTEGRATION_TESTS=minitest bundle exec --gemfile=<< parameters.gemfile >> rake test
- run-fail-fast:
command: MOCHA_RUN_INTEGRATION_TESTS=minitest bundle exec --gemfile=<< parameters.gemfile >> rake test
- when:
condition:
matches:
pattern: ".*test-unit.*"
value: << parameters.gemfile >>
steps:
- run: MOCHA_RUN_INTEGRATION_TESTS=test-unit bundle exec --gemfile=<< parameters.gemfile >> rake test
- run-fail-fast:
command: MOCHA_RUN_INTEGRATION_TESTS=test-unit bundle exec --gemfile=<< parameters.gemfile >> rake test
- when:
condition:
and:
- equal: [ "ruby:latest", << parameters.docker-image >> ]
- equal: [ "Gemfile", << parameters.gemfile >>]
- equal: ["ruby:latest", << parameters.docker-image >>]
- equal: ["Gemfile", << parameters.gemfile >>]
steps:
- run: bundle exec rake test:performance
- run-fail-fast:
command: bundle exec rake test:performance
- run: MOCHA_GENERATE_DOCS=1 bundle install --gemfile=<< parameters.gemfile >>
- run: MOCHA_GENERATE_DOCS=1 rake yardoc
- run: RUBYOPT=--disable-frozen-string-literal MOCHA_GENERATE_DOCS=1 rake docs docs:coverage
lint:
docker:
- image: ruby:2.6
- image: ruby:3.3
steps:
- checkout
- run: ruby --version
- run: gem --version
- run: bundle --version
- run: bundle install --gemfile=Gemfile
- run: bundle exec rake lint
- run: bundle install --gemfile=gemfiles/Gemfile.rubocop
- run: bundle exec --gemfile=gemfiles/Gemfile.rubocop rake lint

workflows:
build-all:
Expand All @@ -70,7 +85,6 @@ workflows:
matrix:
parameters:
docker-image:
- ruby:2.1
- ruby:2.2
- ruby:2.3
- ruby:2.4
Expand All @@ -81,7 +95,7 @@ workflows:
- ruby:3.1
- ruby:3.2
- ruby:3.3
- ruby:3.4.0-preview2
- ruby:3.4
- ruby:latest
- jruby:latest
gemfile:
Expand Down
40 changes: 37 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
require:
- rubocop-rake

inherit_from: .rubocop_todo.yml

inherit_mode:
merge:
- Include

AllCops:
TargetRubyVersion: 2.2 # closest to required_ruby_version of '>= 2.1'
TargetRubyVersion: 2.2

Include:
- '**/Gemfile.*'

Exclude:
- '**/Gemfile*.lock'

NewCops: enable

# Even the reference in the documentation suggests that you should prefer
# `alias_method` vs `alias`, so I don't understand why that isn't the default.
Expand Down Expand Up @@ -50,9 +65,28 @@ Layout/AccessModifierIndentation:
Enabled: false

# Allow long comment lines, e.g. YARD documentation
Metrics/LineLength:
IgnoredPatterns: ['\A\s*#']
Layout/LineLength:
AllowedPatterns: ['\A\s*#']

# It's not possible to set TargetRubyVersion to Ruby < v2.2
Gemspec/RequiredRubyVersion:
Enabled: false

# This cop is useful for required environment variables, but not for optional ones
Style/FetchEnvVar:
AllowedVars:
- MOCHA_RUN_INTEGRATION_TESTS

Naming/FileName:
ExpectMatchingDefinition: true
Exclude:
- lib/mocha/version.rb
- lib/mocha/minitest.rb
- lib/mocha/test_unit.rb
- lib/mocha/ruby_version.rb
- lib/mocha/macos_version.rb
- test/test_helper.rb

Metrics/BlockLength:
Exclude:
- "Rakefile"
38 changes: 25 additions & 13 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2019-11-16 18:15:36 +0000 using RuboCop version 0.58.2.
# on 2025-01-03 14:37:32 UTC using RuboCop version 1.69.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 57
# Offense count: 34
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 26
Max: 27

# Offense count: 23
# Configuration parameters: CountComments.
# Offense count: 28
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 366
Max: 381

# Offense count: 172
# Configuration parameters: CountComments.
# Offense count: 2
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 9

# Offense count: 200
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 31
Max: 27

# Offense count: 3
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 10

# Offense count: 545
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# Offense count: 68
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
# URISchemes: http, https
Metrics/LineLength:
Max: 180
Layout/LineLength:
Max: 173
2 changes: 2 additions & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
--output-dir docs
--no-private
lib/mocha.rb
lib/mocha/api.rb
lib/mocha/hooks.rb
lib/mocha/mock.rb
Expand All @@ -15,6 +16,7 @@ lib/mocha/expectation_error_factory.rb
lib/mocha/expectation_error.rb
lib/mocha/stubbing_error.rb
lib/mocha/unexpected_invocation.rb
lib/mocha/integration.rb
lib/mocha/integration/test_unit/adapter.rb
lib/mocha/integration/minitest/adapter.rb
-
Expand Down
37 changes: 9 additions & 28 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,15 @@ source 'https://rubygems.org'

gemspec

# rubocop:disable Bundler/DuplicatedGem
if RUBY_VERSION < '2.2'
gem 'rake', '~> 12.3.3'
else
group :development do
gem 'benchmark'
gem 'introspection', '~> 0.0.1'
gem 'minitest'
gem 'rake'
end
# rubocop:enable Bundler/DuplicatedGem

gem 'introspection', '~> 0.0.1'

# Avoid breaking change in psych v4 (https://bugs.ruby-lang.org/issues/17866)
if RUBY_VERSION >= '3.1.0'
gem 'psych', '< 4'
end

if RUBY_VERSION >= '2.2.0'
# No test libraries in standard library
gem 'minitest'
end
if RUBY_VERSION >= '2.2.0'
gem 'jaro_winkler', '>= 1.5.5'
gem 'rubocop', '> 0.56', '<= 0.58.2'
end
if RUBY_ENGINE == 'jruby'
# Workaround for https://github.com/jruby/jruby/issues/8488
gem 'jar-dependencies', '~> 0.4.1'
end
if ENV['MOCHA_GENERATE_DOCS']
gem 'redcarpet'
gem 'yard'
if ENV['MOCHA_GENERATE_DOCS']
gem 'rdoc'
gem 'redcarpet'
gem 'yard'
end
end
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,9 @@ If you want, Mocha can generate a warning or raise an exception when:

See the [documentation](https://mocha.jamesmead.org/Mocha/Configuration.html) for `Mocha::Configuration` for further details.

##### MOCHA_OPTIONS
`MOCHA_OPTIONS` is an environment variable whose value can be set to a comma-separated list, so that we can specify multiple options e.g. `MOCHA_OPTIONS=debug,use_test_unit_gem`.
Only the following values are currently recognized and have an effect:
* `debug`: Enables a debug mode which will output backtraces for each deprecation warning. This is useful for finding where in the test suite the deprecated calls are.
### Debugging

Mocha provides some extra output to help with debugging when the standard Ruby debug option (`-d`) is set.

### Semantic versioning

Expand Down
37 changes: 37 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# Release Notes

## 3.0.0-rc.1

### External changes

* Improvements to docs for cardinality-related methods (#700)
* Drop support for Ruby v2.1 (#628 & #695)
* Improve gemspec description (#692 & #696)
* Remove docs for `use_test_unit_gem` option (eaf03493)
* Correct docs for `MOCHA_OPTIONS` "debug" value (69ef41c0)
* Use built-in Ruby debug option vs custom module (#714 & #715)
* Enable strict keyword argument matching by default in Ruby >= v3 (#697 & #718)
* Use Ruby v1.9 Hash syntax in `Hash#mocha_inspect` used in failure messages (#651 & #719)
* Improve `#mocha_inspect` for empty keyword argument `Hash` (#588 & #720) - thanks to @herwinw for reporting
* Improve error if `Mockery.teardown` called before `Mockery.setup` (#611, #646 & #721) - thanks to @riniculous for reporting
* Freeze string literals (#722)
* Remove support for running tests with Minitest < v5 (#727)
* Allow keyword arguments to match an expectation expecting *only* positional arguments (#593 & #732) - thanks to @seandilda
for reporting

### Internal changes

* Add `Expectation#thrice` (#701) - thanks to @andrewn617
* Add `base64` to Gemfile for Ruby >= v3.3.0 to avoid warning (8c49314c & a76330d6)
* Include custom Gemfiles in Rubocop linting (04063f0d)
* Use ruby:3.4.0-rc1 vs ruby:3.4.0-preview2 in CI in preparation for the Ruby v3.4 release (b2127407)
* Add `ostruct` to Gemfile for Ruby >= v3.4.0 to avoid warning (2b05e09e)
* Add Ruby v3.4 to CI build matrix (#708)
* Fix Ruby v3.4 warnings in ObjectInspectTest (#709 & #710)
* Rubocop-related improvements (#702 & #705)
* Consistently use development group in Gemfiles (#706 & #716)
* Add missing requires for 'mocha/ruby_version' (7f99db69)
* Convert `ParameterMatchers::Base` class -> module (#712 & #723)
* Enable `ExpectMatchingDefinition` option on `Naming/FileName` cop (#726)
* Remove duplicate `DefaultReceiverTest` (39d99954)
* Improvements to keyword argument matching tests (#730)
* Improvements to keyword argument matcher unit test (#731)

## 2.7.1

### External changes
Expand Down
Loading