Sha256: 30e64ec09865d07a2a82418eeb76cfdcca316fa18f0d9bb514dfa9080c2a71db

Contents?: true

Size: 669 Bytes

Versions: 1

Compression:

Stored size: 669 Bytes

Contents

require 'spec_helper'

require 'state_mate/adapters/git_config'

describe "StateMate::Adapters::GitConfig.read" do
  include_context "git_config"
  
  it "reads a missing key as nil" do
    expect( git_config.read key ).to eq nil
  end

  context "bad key" do
    let(:bad_key) {
      "state_mate.test"
    }

    it "should error" do
      expect{ git_config.read bad_key }.to raise_error SystemCallError
    end
  end

  context "has a value" do
    let(:value) {
      "blah"
    }

    before(:each) {
      `git config --global --add #{ key } #{ value }`
    }

    it "should read the value" do
      expect( git_config.read key ).to eq value
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

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