Sha256: f88a50ba1628df8149cd20af0bffd2c61ca79f0fc44a13ec3365f3f28d80f648
Contents?: true
Size: 995 Bytes
Versions: 3
Compression:
Stored size: 995 Bytes
Contents
# frozen_string_literal: true require 'minitest/autorun' require 'minitest/pride' require 'mocha/mini_test' require 'ostruct' def context(*args, &block) describe(*args, &block) end def capture_output_streams $stdout = StringIO.new $stderr = StringIO.new yield ensure $stdout = STDOUT $stderr = STDERR end module MiniTest module Assertions ## # Fails unless <tt>exp</tt> and <tt>act</tt> are both arrays and # contain the same elements. # # assert_matched_arrays [3,2,1], [1,2,3] def assert_matched_arrays(exp, act) exp_ary = exp.to_ary assert_kind_of Array, exp_ary act_ary = act.to_ary assert_kind_of Array, act_ary assert_equal exp_ary.sort, act_ary.sort end end module Expectations ## # See MiniTest::Assertions#assert_matched_arrays # # [1,2,3].must_match_array [3,2,1] # # :method: must_match_array infect_an_assertion :assert_matched_arrays, :must_match_array end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rubycritic-3.2.3 | test/test_helper.rb |
rubycritic-3.2.2 | test/test_helper.rb |
rubycritic-3.2.1 | test/test_helper.rb |