Sha256: 51cdebf97a80fd6662e1209d26781839507836e775d1619ca25529ab6bd4ba7e

Contents?: true

Size: 639 Bytes

Versions: 21

Compression:

Stored size: 639 Bytes

Contents

# coding: utf-8
require 'spec_helper'

describe 'Pattern Scanner' do
  describe 'default pattern' do
    let!(:pattern) { I18n::Tasks::Scanners::PatternScanner.new.default_pattern }

    ['t "a.b"', "t 'a.b'", 't("a.b")', "t('a.b')",
     "t('a.b', :arg => val)", "t('a.b', arg: val)",
     "t :a_b", "t :'a.b'", 't :"a.b"', "t(:ab)", "t(:'a.b')", 't(:"a.b")',
    'I18n.t("a.b")', 'I18n.translate("a.b")'].each do |s|
      it "matches #{s}" do
        expect(pattern).to match s
      end
    end

    ["t \"a.b'", "t a.b"].each do |s|
      it "does not match #{s}" do
        expect(pattern).to_not match s
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
i18n-tasks-0.7.8 spec/pattern_scanner_spec.rb
i18n-tasks-0.7.7 spec/pattern_scanner_spec.rb
i18n-tasks-0.7.6 spec/pattern_scanner_spec.rb
i18n-tasks-0.7.5 spec/pattern_scanner_spec.rb
i18n-tasks-0.7.4 spec/pattern_scanner_spec.rb
i18n-tasks-0.7.3 spec/pattern_scanner_spec.rb
i18n-tasks-0.7.2 spec/pattern_scanner_spec.rb
i18n-tasks-0.7.1 spec/pattern_scanner_spec.rb
i18n-tasks-0.7.0 spec/pattern_scanner_spec.rb
i18n-tasks-0.6.3 spec/pattern_scanner_spec.rb
i18n-tasks-0.6.2 spec/pattern_scanner_spec.rb
i18n-tasks-0.6.1 spec/pattern_scanner_spec.rb
i18n-tasks-0.6.0 spec/pattern_scanner_spec.rb
i18n-tasks-0.5.4 spec/pattern_scanner_spec.rb
i18n-tasks-0.5.3 spec/pattern_scanner_spec.rb
i18n-tasks-0.5.2 spec/pattern_scanner_spec.rb
i18n-tasks-0.5.1 spec/pattern_scanner_spec.rb
i18n-tasks-0.5.0 spec/pattern_scanner_spec.rb
i18n-tasks-0.4.5 spec/pattern_scanner_spec.rb
i18n-tasks-0.4.4 spec/pattern_scanner_spec.rb