Sha256: 5653eb9b1e71ddca1336e0582f8b3131a79058e6eae2c822cd87af6aeea005a5

Contents?: true

Size: 627 Bytes

Versions: 6

Compression:

Stored size: 627 Bytes

Contents

require 'test_helper'
require 'tins/xt'

module Tins
  class RespondingTest < Test::Unit::TestCase
    class A
      def foo() end

      def bar() end 
    end

    def test_responding
      assert_equal true, responding?(:foo) === A.new
      assert_equal false, responding?(:jflafjdklfjaslkdfj) === A.new
      assert_equal false, responding?(:jflafjdklfjaslkdfj, :foo) === A.new
      assert_equal true, responding?(:foo, :bar) === A.new
    end

    def test_responding_to_s
      assert_equal 'Responding to foo', responding?(:foo).to_s
      assert_equal 'Responding to foo', responding?(:foo).inspect
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tins-0.7.1 tests/responding_test.rb
tins-0.7.0 tests/responding_test.rb
tins-0.6.0 tests/responding_test.rb
tins-0.5.6 tests/responding_test.rb
tins-0.5.5 tests/responding_test.rb
tins-0.5.4 tests/responding_test.rb