Sha256: a864054bd33bb69cb1142d41f038327ab111cdd9eb474cf871d23c72ec388c04

Contents?: true

Size: 778 Bytes

Versions: 1

Compression:

Stored size: 778 Bytes

Contents

require 'spec_helper'

class GitWorkflow::Configuration
  def self.instance_for_testing
    new
  end
end

describe GitWorkflow::Configuration do
  describe '#username' do
    before(:each) do
      @configuration = described_class.instance_for_testing
    end

    it 'uses pt.username first' do
      @configuration.should_receive(:get_config_value_for).with('pt.username').and_return('pt.username')
      @configuration.username.should == 'pt.username'
    end

    it 'falls back to user.name otherwise' do
      @configuration.should_receive(:get_config_value_for).with('pt.username').and_return(nil)
      @configuration.should_receive(:get_config_value_for!).with('user.name').and_return('user.name')
      @configuration.username.should == 'user.name'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
git_workflow-0.0.5 spec/pivotal_tracker_api/4058718_if_pt_username_is_not_set_use_user_name_spec.rb