Sha256: 77ab71055051c580f8c9c9de6d86777850d9f30376a78c2ecb1f26957c9c5740

Contents?: true

Size: 949 Bytes

Versions: 6

Compression:

Stored size: 949 Bytes

Contents

describe Bisu do
  subject(:run) { Bisu.run([]) }

  context "when there is a translatable.yml" do
    let(:file) { File.open("spec/fixtures/sample.translatable.yml") }

    before do
      allow(Bisu).to receive(:open_file).and_return(file)
      allow_any_instance_of(Bisu::Source::GoogleSheet).to receive(:to_i18).and_return({
        "english" => { "kKey" => "Value" }
      })
      allow(Bisu).to receive(:localize_file)
    end

    it { expect { run }.not_to raise_error }

    it "logs an error" do
      expect {
        run
      }.to not_change { Bisu::Logger.summary[:warn] }
       .and not_change { Bisu::Logger.summary[:error] }
    end
  end

  context "when translatable.yml does not exist locally" do
    it { expect { run }.not_to raise_error }

    it "logs an error" do
      expect {
        run
      }.to not_change { Bisu::Logger.summary[:warn] }
       .and change { Bisu::Logger.summary[:error] }.by(1)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bisu-1.7.3 spec/lib/bisu_spec.rb
bisu-1.7.2 spec/lib/bisu_spec.rb
bisu-1.7.1 spec/lib/bisu_spec.rb
bisu-1.7.0 spec/lib/bisu_spec.rb
bisu-1.6.0 spec/lib/bisu_spec.rb
bisu-1.5.0 spec/lib/bisu_spec.rb