Sha256: a9c5c5d11fb7fa11a96b95fea7e83f4821c1397a76b66fecc62f3aa7bfe901bd

Contents?: true

Size: 774 Bytes

Versions: 126

Compression:

Stored size: 774 Bytes

Contents

require 'pact_broker/config/load'
require 'pact_broker/config/save'

module PactBroker
  module Config
    describe "Save and Load" do

      let(:setting_names) { configuration_to_save.to_h.keys }
      let(:configuration_to_save) do
        OpenStruct.new(foo: true, bar: false, wiffle: nil, meep: [1, "2"], mop: {a: "b"}, la: 1, lala: 1.2)
      end

      let(:loaded_configuration) do
        OpenStruct.new(foo: nil, bar: "1", wiffle: [], meep: nil, mop: nil, la: nil, lala: nil)
      end

      subject { Save.call(configuration_to_save, setting_names); Load.call(loaded_configuration) }

      it "the loaded configuration is the same as the saved one" do
        subject
        expect(loaded_configuration).to eq configuration_to_save
      end
    end
  end
end

Version data entries

126 entries across 126 versions & 1 rubygems

Version Path
pact_broker-2.36.1 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.36.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.35.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.34.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.33.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.32.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.31.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.30.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.29.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.27.6 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.27.5 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.27.4 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.27.3 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.27.2 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.27.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.26.1 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.26.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.25.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.24.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.23.4 spec/lib/pact_broker/config/save_and_load_spec.rb