minitest-global_expectations-1.0.2/ 0000755 0000041 0000041 00000000000 15121602662 017423 5 ustar www-data www-data minitest-global_expectations-1.0.2/README.rdoc 0000644 0000041 0000041 00000001661 15121602662 021235 0 ustar www-data www-data = minitest-global_expectations
minitest-global_expectations allows you to keep using simple code in your
minitest specs, without having to wrap every single object you are calling
an expectation method on with _:
# You can use:
foo.must_equal 1
# instead of:
_(foo).must_equal 1
Calling expectation methods on all objects was supported in Minitest <5.12,
was deprecated in Minitest 5.12, and is planned to be removed from Minitest 6.
= Installation
gem install minitest-global_expectations
= Source Code
Source code is available on GitHub at https://github.com/jeremyevans/minitest-global_expectations
= Usage
Just require the library. You can switch requires of +minitest/spec+ to:
require 'minitest/global_expectations'
Alternatively, if you are requiring +minitest/autorun+, you can switch to:
require 'minitest/global_expectations/autorun'
= License
MIT
= Author
Jeremy Evans
minitest-global_expectations-1.0.2/lib/ 0000755 0000041 0000041 00000000000 15121602662 020171 5 ustar www-data www-data minitest-global_expectations-1.0.2/lib/minitest/ 0000755 0000041 0000041 00000000000 15121602662 022025 5 ustar www-data www-data minitest-global_expectations-1.0.2/lib/minitest/global_expectations/ 0000755 0000041 0000041 00000000000 15121602662 026053 5 ustar www-data www-data minitest-global_expectations-1.0.2/lib/minitest/global_expectations/autorun.rb 0000644 0000041 0000041 00000000102 15121602662 030066 0 ustar www-data www-data require 'minitest/autorun'
require 'minitest/global_expectations'
minitest-global_expectations-1.0.2/lib/minitest/global_expectations.rb 0000644 0000041 0000041 00000002226 15121602662 026402 0 ustar www-data www-data require 'minitest/spec'
# :nocov:
module MinitestGlobalExpectations
if Minitest::VERSION >= '6'
# :nocov:
class ::Minitest::Spec
def self.current
Thread.current[:current_spec]
end
def initialize name # :nodoc:
super
Thread.current[:current_spec] = self
end
end
end
[
:must_be_empty,
:must_equal,
:must_be_close_to,
:must_be_within_epsilon,
:must_include,
:must_be_instance_of,
:must_be_kind_of,
:must_match,
:must_be_nil,
:must_be,
:must_output,
:must_raise,
:must_respond_to,
:must_be_same_as,
:must_be_silent,
:must_throw,
:wont_be_empty,
:wont_equal,
:wont_be_close_to,
:wont_be_within_epsilon,
:wont_include,
:wont_be_instance_of,
:wont_be_kind_of,
:wont_match,
:wont_be_nil,
:wont_be,
:wont_respond_to,
:wont_be_same_as,
].each do |meth|
self.class_eval(<<-EOM, __FILE__, __LINE__ + 1)
def #{meth}(*args)
Minitest::Expectation.new(self, Minitest::Spec.current).#{meth}(*args)
end
EOM
end
::Object.send(:include, self)
end if defined?(Minitest::Expectation)
minitest-global_expectations-1.0.2/MIT-LICENSE 0000644 0000041 0000041 00000002021 15121602662 021052 0 ustar www-data www-data Copyright (c) 2019 Jeremy Evans
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
minitest-global_expectations-1.0.2/minitest-global_expectations.gemspec 0000644 0000041 0000041 00000004141 15121602662 026650 0 ustar www-data www-data #########################################################
# This file has been automatically generated by gem2tgz #
#########################################################
# -*- encoding: utf-8 -*-
# stub: minitest-global_expectations 1.0.2 ruby lib
Gem::Specification.new do |s|
s.name = "minitest-global_expectations".freeze
s.version = "1.0.2".freeze
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.metadata = { "bug_tracker_uri" => "https://github.com/jeremyevans/minitest-global_expectations/issues", "changelog_uri" => "https://github.com/jeremyevans/minitest-global_expectations/blob/master/CHANGELOG", "mailing_list_uri" => "https://github.com/jeremyevans/minitest-global_expectations/discussions", "source_code_uri" => "https://github.com/jeremyevans/minitest-global_expectations" } if s.respond_to? :metadata=
s.require_paths = ["lib".freeze]
s.authors = ["Jeremy Evans".freeze]
s.date = "1980-01-02"
s.description = "minitest-global_expectations allows you to keep using simple code in your\nminitest specs, without having to wrap every single object you are calling\nan expectation method on with an underscore.\n".freeze
s.email = "code@jeremyevans.net".freeze
s.extra_rdoc_files = ["CHANGELOG".freeze, "MIT-LICENSE".freeze, "README.rdoc".freeze]
s.files = ["CHANGELOG".freeze, "MIT-LICENSE".freeze, "README.rdoc".freeze, "lib/minitest/global_expectations.rb".freeze, "lib/minitest/global_expectations/autorun.rb".freeze]
s.homepage = "https://github.com/jeremyevans/minitest-global_expectations".freeze
s.licenses = ["MIT".freeze]
s.rdoc_options = ["--quiet".freeze, "--line-numbers".freeze, "--inline-source".freeze, "--title".freeze, "minitest-global_expectations: add expectation methods to all objects".freeze, "--main".freeze, "README.rdoc".freeze]
s.required_ruby_version = Gem::Requirement.new(">= 1.8".freeze)
s.rubygems_version = "4.0.2".freeze
s.summary = "Support minitest expectation methods for all objects".freeze
s.specification_version = 4
s.add_runtime_dependency(%q.freeze, ["> 5".freeze])
end
minitest-global_expectations-1.0.2/CHANGELOG 0000644 0000041 0000041 00000000301 15121602662 020627 0 ustar www-data www-data === 1.0.2 (2025-12-18)
* Work correctly on minitest 6+ (jeremyevans)
=== 1.0.1 (2019-09-24)
* Work correctly on minitest <5.6 (jeremyevans)
=== 1.0.0 (2019-09-24)
* Initial Public Release