Sha256: 5e840d3c9c7f97af88688d583cae99e89b2fd0c89f5e84abf7c3f05423268a80

Contents?: true

Size: 783 Bytes

Versions: 2

Compression:

Stored size: 783 Bytes

Contents

require 'spec_helper'

require 'state_mate/adapters/defaults'

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

  {
    string: 'en_US@currency=USD',
    data:   '62706c697374',
    int:    '1',
    float:  '1',
    bool:   'true',
    date:   '2014-03-27',
    array:  '1 2 3',
    dict:   'x 1 y 2',
  }.each do |type, input|

    it "reads a #{ type } type" do
      `defaults write #{ DOMAIN } x -#{ type } #{ input }`
      expect( defaults.read_type DOMAIN, 'x', false ).to be type
    end

    it "reads a #{ type } type from current host" do
      `defaults -currentHost write #{ DOMAIN } x -#{ type } #{ input }`
      expect( defaults.read_type DOMAIN, 'x', true ).to be type
    end    

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
state_mate-0.0.3 spec/state_mate/adapters/defaults/read_type_spec.rb
state_mate-0.0.2 spec/state_mate/adapters/defaults/read_type_spec.rb