Sha256: 8e7a4698b9774209d29ab86ba18122917800b05eb608b48673835713fd27f775

Contents?: true

Size: 471 Bytes

Versions: 6

Compression:

Stored size: 471 Bytes

Contents

RSpec::Matchers.define :internationalize do |non_i18n_string|
  chain :to do |i18n_string|
    @i18n_string = i18n_string
  end

  chain :to_the_same do
    @i18n_string = non_i18n_string
  end

  match do |pattern_matcher|
    @converted = pattern_matcher.run(non_i18n_string)
    @converted == @i18n_string
  end

  failure_message_for_should do |pattern_matcher|
    "#{non_i18n_string} was converted to
     #{@converted} but expected
     #{@i18n_string}"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
i15r-0.5.5 spec/support/internationalize_matcher.rb
i15r-0.5.4 spec/support/internationalize_matcher.rb
i15r-0.5.3 spec/support/internationalize_matcher.rb
i15r-0.5.2 spec/support/internationalize_matcher.rb
i15r-0.5.1 spec/support/internationalize_matcher.rb
i15r-0.5.0 spec/support/internationalize_matcher.rb