minitest-global-expectations-1.0.1/0000755000175000017500000000000013642655172017246 5ustar utkarshutkarshminitest-global-expectations-1.0.1/Rakefile0000644000175000017500000000060213642655172020711 0ustar utkarshutkarshrequire "rake" require "rake/clean" CLEAN.include ["minitest-global_expectations-*.gem"] desc "Build minitest-global_expectations gem" task :package=>[:clean] do |p| sh %{#{FileUtils::RUBY} -S gem build minitest-global_expectations.gemspec} end ### Specs desc "Run test" task :test do sh %{#{FileUtils::RUBY} test/minitest_global_expectations_test.rb} end task :default=>:test minitest-global-expectations-1.0.1/CHANGELOG0000644000175000017500000000017213642655172020460 0ustar utkarshutkarsh=== 1.0.1 (2019-09-24) * Work correctly on minitest <5.6 (jeremyevans) === 1.0.0 (2019-09-24) * Initial Public Release minitest-global-expectations-1.0.1/test/0000755000175000017500000000000013642655172020225 5ustar utkarshutkarshminitest-global-expectations-1.0.1/test/minitest_global_expectations_test.rb0000644000175000017500000000210713642655172027553 0ustar utkarshutkarsh$:.unshift(File.join(File.dirname(File.expand_path(__FILE__)), "../lib/")) require 'rubygems' ENV['MT_NO_PLUGINS'] = '1' # Work around stupid autoloading of plugins gem 'minitest' require 'minitest/global_expectations/autorun' describe "minitest-global_expectations" do it "should allow calling expectation methods on all objects" do [].must_be_empty 1.must_equal 1 1.0.must_be_close_to 1.000000001 1.0.must_be_within_epsilon 1.000000001 [1].must_include 1 Object.new.must_be_instance_of Object 1.must_be_kind_of Numeric 'a'.must_match(/a/) nil.must_be_nil 1.must_be :==, 1 proc{print '.'}.must_output('.') proc{raise}.must_raise RuntimeError 1.must_respond_to :abs true.must_be_same_as true proc{}.must_be_silent proc{throw :foo}.must_throw :foo [1].wont_be_empty 1.wont_equal 2 1.wont_be_close_to 2 1.wont_be_within_epsilon 2 [1].wont_include 2 1.wont_be_instance_of Numeric 1.wont_be_kind_of Hash 'a'.wont_match(/b/) 1.wont_be_nil 1.wont_be :==, 2 1.wont_respond_to :foo end end minitest-global-expectations-1.0.1/minitest-global_expectations.gemspec0000644000175000017500000000353213642655172026476 0ustar utkarshutkarsh######################################################### # This file has been automatically generated by gem2tgz # ######################################################### # -*- encoding: utf-8 -*- # stub: minitest-global_expectations 1.0.1 ruby lib Gem::Specification.new do |s| s.name = "minitest-global_expectations".freeze s.version = "1.0.1" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Jeremy Evans".freeze] s.date = "2019-09-24" 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, "Rakefile".freeze, "lib/minitest/global_expectations.rb".freeze, "lib/minitest/global_expectations/autorun.rb".freeze, "test/minitest_global_expectations_test.rb".freeze] s.homepage = "http://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.rubygems_version = "3.1.2".freeze s.summary = "Support minitest expectation methods for all objects".freeze if s.respond_to? :specification_version then s.specification_version = 4 end if s.respond_to? :add_runtime_dependency then s.add_runtime_dependency(%q.freeze, ["> 5"]) else s.add_dependency(%q.freeze, ["> 5"]) end end minitest-global-expectations-1.0.1/README.rdoc0000644000175000017500000000166113642655172021060 0ustar utkarshutkarsh= 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.1/MIT-LICENSE0000644000175000017500000000202113642655172020675 0ustar utkarshutkarshCopyright (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.1/lib/0000755000175000017500000000000013642655172020014 5ustar utkarshutkarshminitest-global-expectations-1.0.1/lib/minitest/0000755000175000017500000000000013642655172021650 5ustar utkarshutkarshminitest-global-expectations-1.0.1/lib/minitest/global_expectations/0000755000175000017500000000000013642655172025676 5ustar utkarshutkarshminitest-global-expectations-1.0.1/lib/minitest/global_expectations/autorun.rb0000644000175000017500000000010213642655172027711 0ustar utkarshutkarshrequire 'minitest/autorun' require 'minitest/global_expectations' minitest-global-expectations-1.0.1/lib/minitest/global_expectations.rb0000644000175000017500000000161113642655172026222 0ustar utkarshutkarshrequire 'minitest/spec' module MinitestGlobalExpectations [ :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)