Sha256: 3c399b4a903cb56b3bc054aeeb86970e874f651fb08256f5b28c98fea27e5525

Contents?: true

Size: 612 Bytes

Versions: 6

Compression:

Stored size: 612 Bytes

Contents

require 'spec_helper'

describe 'Pattern Scanner' do
  describe 'default pattern' do
    let!(:pattern) { I18n::Tasks::Scanners::PatternScanner::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
        pattern.should match s
      end
    end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
i18n-tasks-0.2.22 spec/pattern_scanner_spec.rb
i18n-tasks-0.2.21 spec/pattern_scanner_spec.rb
i18n-tasks-0.2.20 spec/pattern_scanner_spec.rb
i18n-tasks-0.2.19 spec/pattern_scanner_spec.rb
i18n-tasks-0.2.18 spec/pattern_scanner_spec.rb
i18n-tasks-0.2.17 spec/pattern_scanner_spec.rb