Sha256: 025134360e7c84deca30ff73414fc33ec46c6e87524fc4b354a66c4a979cff00

Contents?: true

Size: 918 Bytes

Versions: 69

Compression:

Stored size: 918 Bytes

Contents

require 'test_helper'
require 'tins'

module Tins
  class ExtractLastArgumentOptionsTest < Test::Unit::TestCase
    require 'tins/xt/extract_last_argument_options'

    def test_empty_argument_array
      arguments = []
      result = arguments.extract_last_argument_options
      assert_equal [ [], {} ], result
      assert_not_same arguments, result.first
    end

    def test_argument_array_without_options
      arguments = [ 1, 2, 3 ]
      result = arguments.extract_last_argument_options
      assert_equal [ [ 1, 2, 3 ], {} ], result
      assert_not_same arguments, result.first
    end

    def test_argument_array_witt_options
      arguments = [ 1, 2, 3, { :foo => :bar } ]
      result = arguments.extract_last_argument_options
      assert_equal [ [ 1, 2, 3 ], { :foo => :bar } ], result
      assert_not_same arguments, result.first
      assert_not_same arguments.last, result.last
    end
  end
end

Version data entries

69 entries across 67 versions & 7 rubygems

Version Path
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/tins-0.13.2/tests/extract_last_argument_options_test.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/tins-0.13.2/tests/extract_last_argument_options_test.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/tins-0.13.2/tests/extract_last_argument_options_test.rb
tdiary-5.0.8 vendor/bundle/gems/tins-0.13.2/tests/extract_last_argument_options_test.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/tins-1.6.0/tests/extract_last_argument_options_test.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/tins-1.6.0/tests/extract_last_argument_options_test.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/tins-1.6.0/tests/extract_last_argument_options_test.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/tins-1.6.0/tests/extract_last_argument_options_test.rb
suzuko-0.1.8 vendor/bundle/ruby/2.0.0/gems/tins-1.6.0/tests/extract_last_argument_options_test.rb
suzuko-0.1.7 vendor/bundle/ruby/2.0.0/gems/tins-1.6.0/tests/extract_last_argument_options_test.rb
mastermind_adeybee-0.1.4 vendor/bundle/ruby/2.2.0/gems/tins-1.6.0/tests/extract_last_argument_options_test.rb
mastermind_adeybee-0.1.3 vendor/bundle/ruby/2.2.0/gems/tins-1.6.0/tests/extract_last_argument_options_test.rb
mastermind_adeybee-0.1.2 vendor/bundle/ruby/2.2.0/gems/tins-1.6.0/tests/extract_last_argument_options_test.rb
mastermind_adeybee-0.1.1 vendor/bundle/ruby/2.2.0/gems/tins-1.6.0/tests/extract_last_argument_options_test.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/tins-1.6.0/tests/extract_last_argument_options_test.rb
tins-1.6.0 tests/extract_last_argument_options_test.rb
tins-1.5.4 tests/extract_last_argument_options_test.rb
tins-1.5.3 tests/extract_last_argument_options_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/tins-1.5.2/tests/extract_last_argument_options_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/tins-1.5.1/tests/extract_last_argument_options_test.rb