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.51.0 vendor/gems/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
ehbrs-tools-0.12.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
ehbrs-tools-0.11.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
ehbrs-tools-0.10.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
ehbrs-tools-0.9.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
ehbrs-tools-0.7.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
ehbrs-tools-0.6.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
ehbrs-tools-0.5.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
ehbrs-tools-0.3.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb
ehbrs-tools-0.3.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb