Sha256: c69d5e463c836e8d8b760503ad8ee942f4c21e8cd38782e3efaa2fc84e03fd6b

Contents?: true

Size: 1.46 KB

Versions: 29

Compression:

Stored size: 1.46 KB

Contents

require 'test_helper'

class ArrayTest < Test::Unit::TestCase
  
  context "Method" do
    setup do
      @cat = "cat"
      @bound = @cat.method(:upcase) 
    end
    
    context "#name" do
      should "conform to doc" do
        assert_equal "upcase", @bound.name
      end
    end
  
    context "#owner" do
      should "conform to doc" do
        assert_equal String, @bound.owner
      end
    end
  
    context "#receiver" do
      should "conform to doc" do
        assert @cat === @bound.receiver
      end
    end
  
    context "Unbound" do
      setup do
        @unbound = @bound.unbind
      end
      
      context "#name" do
        should "conform to doc" do
          assert_equal "upcase", @unbound.name
        end
      end
  
      context "#owner" do
        should "conform to doc" do
          assert_equal String, @unbound.owner
        end
      end
      
      context "bound again" do
        setup do
          @dog = "dog"
          @bound_again = @unbound.bind(@dog)
        end
        
        context "#name" do
          should "conform to doc" do
            assert_equal "upcase", @bound_again.name
          end
        end
  
        context "#owner" do
          should "conform to doc" do
            assert_equal String, @bound_again.owner
          end
        end
  
        context "#receiver" do
          should "conform to doc" do
            assert @dog === @bound_again.receiver
          end
        end
  
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
backports-2.3.0 test/method_test.rb
backports-2.2.1 test/method_test.rb
backports-2.2.0 test/method_test.rb
backports-2.1.0 test/method_test.rb
backports-2.0.3 test/method_test.rb
backports-2.0.2 test/method_test.rb
backports-2.0.1 test/method_test.rb
backports-2.0.0 test/method_test.rb
backports-1.18.2 test/method_test.rb
backports-1.18.1 test/method_test.rb
backports-1.18.0 test/method_test.rb
backports-1.17.1 test/method_test.rb
backports-1.17.0 test/method_test.rb
backports-1.16.7 test/method_test.rb
backports-1.16.6 test/method_test.rb
backports-1.16.5 test/method_test.rb
backports-1.16.4 test/method_test.rb
backports-1.16.3 test/method_test.rb
backports-1.16.2 test/method_test.rb
backports-1.16.1 test/method_test.rb