Sha256: d5aaff391813f900ad311c691cb053b2b53c100cbb450f98f41dbc477a3c5e60

Contents?: true

Size: 713 Bytes

Versions: 50

Compression:

Stored size: 713 Bytes

Contents

# frozen_string_literal: true

require 'tempfile'
require 'eac_ruby_utils/configs'

RSpec.describe ::EacRubyUtils::Configs do
  let(:configs_key) { 'configsspec' }
  let(:storage_path) do
    file = ::Tempfile.new(configs_key)
    path = file.path
    file.close
    file.unlink
    path
  end
  let(:instance) { described_class.new(configs_key, storage_path: storage_path) }

  describe '#storage_path' do
    it { expect(instance.storage_path).to eq(storage_path) }
  end

  describe '#write' do
    let(:entry_key) { 'parent.child' }

    before do
      instance[entry_key] = 'value1'
      instance.save
    end

    it { expect(::YAML.load_file(storage_path)).to eq(parent: { child: 'value1' }) }
  end
end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
avm-tools-0.72.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.71.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.70.2 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
ehbrs-tools-0.15.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
ehbrs-tools-0.14.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.70.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.70.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.69.3 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
ehbrs-tools-0.14.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.69.2 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.69.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.69.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
ehbrs-tools-0.13.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.68.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.67.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.66.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.65.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.64.2 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.64.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
avm-tools-0.64.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb