Sha256: 252219efe177ea71c670911b83d10c85011130ba7a98b6f4f7c4633f984d88ce
Contents?: true
Size: 1.76 KB
Versions: 2
Compression:
Stored size: 1.76 KB
Contents
require 'spec_helper' require 'git_helper' describe GitHelper::GitConfigReader do let(:github_token) { '1234ASDF1234ASDF' } let(:gitlab_token) { 'ASDF123ASDF1234' } let(:config_file) { { github_user: 'github-user-name', github_token: github_token, gitlab_user: 'gitlab-user-name', gitlab_token: gitlab_token } } subject { GitHelper::GitConfigReader.new } describe '#gitlab_token' do it 'should locate the gitlab_token' do expect(subject).to receive(:config_file).and_return(config_file) expect(subject.gitlab_token).to eq(gitlab_token) end it 'should call the config file' do expect(subject).to receive(:config_file).and_return(config_file) subject.gitlab_token end end describe '#github_token' do it 'should locate the github_token' do expect(subject).to receive(:config_file).and_return(config_file) expect(subject.github_token).to eq(github_token) end it 'should call the config file' do expect(subject).to receive(:config_file).and_return(config_file) subject.github_token end end describe '#config_file' do it 'should yaml load the file path' do expect(YAML).to receive(:load_file) subject.send(:config_file) end end describe '#git_config_file_path' do it 'should look in the current directory' do expect(Dir).to receive(:pwd).and_return('/Users/firstnamelastname/path/to/git_helper') subject.send(:git_config_file_path) end it 'should return the base path with the git config file at the end' do allow(Dir).to receive(:pwd).and_return('/Users/firstnamelastname/path/to/git_helper') expect(subject.send(:git_config_file_path)).to eq('/Users/firstnamelastname/.git_config.yml') end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
git_helper-2.0.2 | spec/git_helper/git_config_reader_spec.rb |
git_helper-2.0.1 | spec/git_helper/git_config_reader_spec.rb |