Sha256: 362ebf9c5bc8d6fe2d9d51b3739eaee6f9d9a25c53e8e5e43a8a57064a461921

Contents?: true

Size: 941 Bytes

Versions: 9

Compression:

Stored size: 941 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::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

9 entries across 9 versions & 1 rubygems

Version Path
bisu-1.4.7 spec/lib/bisu_spec.rb
bisu-1.4.6 spec/lib/bisu_spec.rb
bisu-1.4.5 spec/lib/bisu_spec.rb
bisu-1.4.4 spec/lib/bisu_spec.rb
bisu-1.4.3 spec/lib/bisu_spec.rb
bisu-1.4.2 spec/lib/bisu_spec.rb
bisu-1.4.1 spec/lib/bisu_spec.rb
bisu-1.4.0 spec/lib/bisu_spec.rb
bisu-1.3.1 spec/lib/bisu_spec.rb