Sha256: 0cd4fc5ff10ef3046fb5b52fcab11a260a5871bbfb0693e7f0bacce09d5f37d6

Contents?: true

Size: 739 Bytes

Versions: 15

Compression:

Stored size: 739 Bytes

Contents

module InputModeMatchers
  { :hiragana => '-wap-input-format:"*<ja:h>"',
    :hankaku => '-wap-input-format:"*<ja:hk>"',
    :alphabetic => '-wap-input-format:"*<ja:en>"',
    :numeric => '-wap-input-format:"*<ja:n>"'
  }.each do |mode, style|
    define_method("be_docomo_#{mode}") { DocomoInputMode.new style }
  end

  class DocomoInputMode
    def initialize(expected)
      @expected = expected
    end

    def matches?(target)
      @target = target
      @target["style"].eql?(@expected)
    end

    def failure_message_for_should
      "expected #{@target.native} to have style='#{@expected}'"
    end

    def failure_message_for_should_not
      "expected #{@target.native} not to have style='#{@expected}'"
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
galakei-0.15.2 spec/acceptance/support/input_mode_matchers.rb
galakei-0.15.1 spec/acceptance/support/input_mode_matchers.rb
galakei-0.15.0 spec/acceptance/support/input_mode_matchers.rb
galakei-0.14.4 spec/acceptance/support/input_mode_matchers.rb
galakei-0.14.3 spec/acceptance/support/input_mode_matchers.rb
galakei-0.14.2 spec/acceptance/support/input_mode_matchers.rb
galakei-0.14.1 spec/acceptance/support/input_mode_matchers.rb
galakei-0.14.0 spec/acceptance/support/input_mode_matchers.rb
galakei-0.13.7 spec/acceptance/support/input_mode_matchers.rb
galakei-0.13.6 spec/acceptance/support/input_mode_matchers.rb
galakei-0.13.5 spec/acceptance/support/input_mode_matchers.rb
galakei-0.13.4 spec/acceptance/support/input_mode_matchers.rb
galakei-0.13.3 spec/acceptance/support/input_mode_matchers.rb
galakei-0.13.2 spec/acceptance/support/input_mode_matchers.rb
galakei-0.13.1 spec/acceptance/support/input_mode_matchers.rb