Sha256: 6542c0a3e91c92a90ebbde98ac18ade95d2234dd50682ae8f69acc24a50bb376

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

$LOAD_PATH.<< File.expand_path '../../lib', __FILE__
require 'invokr'

require 'minitest'
require 'minitest/autorun'
require 'minitest/red_green'

module TestMethodBank
  extend self

  def required_argument album
    album
  end

  def optional_argument album = 'junta'
    album
  end

  def double_optional_argument album1 = 'junta', album2 = 'rift'
  end

  def block_argument &album_block
    album_block.call
  end

  def multiple_required_arguments album, guitarist
    [album, guitarist]
  end

  def one_required_one_optional_argument album, guitarist = 'trey'
    [album, guitarist]
  end

  def splat_argument album = 'junta', *rest
    [album, *rest]
  end

  def just_yields
    yield
  end

  def inspect
    "#<#{name}:0xdeadbeef>"
  end

  if RUBY_VERSION >= '2.0'  and RUBY_ENGINE == 'ruby'
    module_eval <<-RB, __FILE__, __LINE__
      def optional_keyword_argument album: 'pitcher_of_nectar'
        album
      end

      def keyword_splat_argument album: 'pitcher_of_nectar', **rest
        [album, **rest]
      end
    RB
  end

  if RUBY_VERSION >= '2.1' and RUBY_ENGINE == 'ruby'
    module_eval <<-RB, __FILE__, __LINE__
      def required_keyword_argument(album:)
        album
      end
    RB
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
invokr-0.9.7 test/test_helper.rb
invokr-0.9.6 test/test_helper.rb
invokr-0.9.5 test/test_helper.rb