Sha256: 32ec8b315a9e365d16cced08e43253252a8e7da5cf70a704c97942c5d80d265e

Contents?: true

Size: 615 Bytes

Versions: 22

Compression:

Stored size: 615 Bytes

Contents

require 'spec_helper'

describe Localeapp, "#load_yaml(content)" do
  let(:bad_yaml) { "---\n- 1\n- 2\n- 3\n- !ruby/object:Object\n    foo: 1\n" }

  it "raises an exception if the content contains potentially insecure yaml" do
    with_configuration(:raise_on_insecure_yaml => true) do
      expect { Localeapp.load_yaml(bad_yaml) }.to raise_error(Localeapp::PotentiallyInsecureYaml)
    end
  end

  it "doesn't raise if the raise_on_insecure_yaml setting is false" do
    with_configuration(:raise_on_insecure_yaml => false) do
      expect { Localeapp.load_yaml(bad_yaml) }.to_not raise_error
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
localeapp-2.3.0 spec/localeapp_spec.rb
localeapp-2.2.0 spec/localeapp_spec.rb
localeapp-2.1.1 spec/localeapp_spec.rb
localeapp-2.1.0 spec/localeapp_spec.rb
localeapp-2.0.0 spec/localeapp_spec.rb
localeapp-1.0.2 spec/localeapp_spec.rb
localeapp-1.0.1 spec/localeapp_spec.rb
localeapp-1.0.0 spec/localeapp_spec.rb
localeapp-0.9.3 spec/localeapp_spec.rb
localeapp-0.9.2 spec/localeapp_spec.rb
localeapp-0.9.1 spec/localeapp_spec.rb
localeapp-0.9.0 spec/localeapp_spec.rb
localeapp-0.8.1 spec/localeapp_spec.rb
localeapp-0.8.0 spec/localeapp_spec.rb
localeapp-0.7.2 spec/localeapp_spec.rb
localeapp-0.7.1 spec/localeapp_spec.rb
localeapp-0.7.0 spec/localeapp_spec.rb
localeapp-0.6.14 spec/localeapp_spec.rb
localeapp-0.6.13 spec/localeapp_spec.rb
localeapp-0.6.12 spec/localeapp_spec.rb