Sha256: a69728567874043258fd4f18d4aa217557148a172653820572cfc604398518eb

Contents?: true

Size: 1.71 KB

Versions: 1

Compression:

Stored size: 1.71 KB

Contents

require "spec_helper"

describe I18nScrewdriver do
  describe "grab_js_texts_to_be_translated" do
    it "properly parses the passed string" do
      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw("test!")|)).to eq(["test!"])
      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw( "test!")|)).to eq(["test!"])
      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw("Hi %{name}!", name: "gucki")|)).to eq(["Hi %{name}!"])
      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw "test!"|)).to eq(["test!"])
      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw "Hi %{name}!", name: "gucki"|)).to eq(["Hi %{name}!"])

      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw('test!')|)).to eq(["test!"])
      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw( 'test!')|)).to eq(["test!"])
      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw('Hi %{name}!', name: "gucki")|)).to eq(["Hi %{name}!"])
      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw 'test!'|)).to eq(["test!"])
      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw 'Hi %{name}!', name: "gucki"|)).to eq(["Hi %{name}!"])

      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw(`test!`)|)).to eq(["test!"])
      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw( `test!`)|)).to eq(["test!"])
      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw(`Hi ${name}!`)"|)).to eq(["Hi ${name}!"])
      expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw(`Hi %{name}!`, name: "gucki")|)).to eq(["Hi %{name}!"])
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
i18n_screwdriver-9.2 spec/i18n_screwdriver_spec.rb