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.79.1 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.79.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.78.1 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.78.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.77.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.76.2 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.76.1 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.76.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.75.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.74.1 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.74.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.73.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.72.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.71.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.70.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.69.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.68.1 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.68.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.67.0 spec/lib/pact_broker/config/save_and_load_spec.rb
pact_broker-2.66.0 spec/lib/pact_broker/config/save_and_load_spec.rb