Sha256: d00c015bd6f7e331b7d0ea613645294e3a4abee390bef522db8b28869eef9bee

Contents?: true

Size: 938 Bytes

Versions: 35

Compression:

Stored size: 938 Bytes

Contents

require "spec_helper"
require "gettext_i18n_rails/slim_parser"

describe GettextI18nRails::SlimParser do
  let(:parser){ GettextI18nRails::SlimParser }

  describe "#target?" do
    it "targets .slim" do
      parser.target?('foo/bar/xxx.slim').should == true
    end

    it "does not target anything else" do
      parser.target?('foo/bar/xxx.erb').should == false
    end
  end

  describe "#parse" do
    it "finds messages in slim" do
      with_file 'div = _("xxxx")' do |path|
        parser.parse(path, []).should == [
          ["xxxx", "#{path}:1"]
        ]
      end
    end

    xit "can parse 1.9 syntax" do
      with_file 'div = _("xxxx", foo: :bar)' do |path|
        parser.parse(path, []).should == [
          ["xxxx", "#{path}:1"]
        ]
      end
    end

    it "does not find messages in text" do
      with_file 'div _("xxxx")' do |path|
        parser.parse(path, []).should == []
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
gettext_i18n_rails-1.0.2 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-1.0.1 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-1.0.0 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.10.1 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.10.0 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.9.4 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.9.3 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.9.2 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.9.1 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.9.0 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.8.0 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.7.2 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.7.1 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.7.0 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.6.6 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.6.5 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.6.4 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.6.3 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.6.2 spec/gettext_i18n_rails/slim_parser_spec.rb
gettext_i18n_rails-0.6.1 spec/gettext_i18n_rails/slim_parser_spec.rb