Sha256: 4659c1393c98e2a11577f0a9b931063e0a17a02c133cd81fe4f8aeeeb247d99e
Contents?: true
Size: 947 Bytes
Versions: 12
Compression:
Stored size: 947 Bytes
Contents
require_relative '../../test_helper' require_relative '../../fixtures/wut' DuckPuncher.punch! :Method class MethodTest < MiniTest::Test # Called before every test method runs. Can be used # to set up fixture information. def setup @subject = Wut.new end def test_to_instruct assert_match /:to_a/, @subject.method(:to_a).to_instruct assert_match /newarray/, @subject.method(:to_a).to_instruct assert_match /opt_plus/, @subject.method(:to_a).to_instruct assert_equal nil, [].method(:to_s).to_instruct end def test_to_instruct_single_line assert_match /:to_f/, @subject.method(:to_f).to_instruct assert_match /getconstant\s*:INFINITY/, @subject.method(:to_f).to_instruct end def test_to_source assert_equal "def to_a\n ['w'] + ['u'] + ['t']\nend\n", @subject.method(:to_a).to_source end def test_to_source_with_no_source assert_equal '', @subject.method(:object_id).to_source end end
Version data entries
12 entries across 12 versions & 1 rubygems