Sha256: 84adb99372deb545c5f36fe859a5b498dc2e6c6fc349810b6394a2975d20ada2

Contents?: true

Size: 619 Bytes

Versions: 1

Compression:

Stored size: 619 Bytes

Contents

require 'spec_helper'

require 'state_mate/adapters/defaults'

describe "StateMate::Adapters::Defaults.read" do
  include_context "defaults"
  include_context "#{ DOMAIN } empty"

  let(:key) {
    'x'
  }

  it "returns nil when the key is missing" do
    expect( defaults.read [DOMAIN, key] ).to be nil
  end

  context "string value with @ in it" do

    let(:string) {
      'en_US@currency=USD'
    }

    before(:each) {
      `defaults write #{ DOMAIN } #{ key } -string '#{ string }'`
    }

    it "reads a string with an @ in it" do
      expect( defaults.read [DOMAIN, key] ).to eq string
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
state_mate-0.0.1 spec/state_mate/adapters/defaults/read_spec.rb