Sha256: 9263124f89cce96bb22a69084d63c996b321e2983aefabca0a1672b0792234db

Contents?: true

Size: 560 Bytes

Versions: 3

Compression:

Stored size: 560 Bytes

Contents

require 'spec_helper'

describe GithubCLI::API do
  context '#github_api' do
    before(:each) { described_class.send(:class_variable_set, :@@api, nil) }

    it 'sets up github api connection' do
      github_instance = stub
      Github.should_receive(:new).and_return github_instance
      described_class.github_api.should == github_instance
    end

    it 'does not instantiate on subsequent calls' do
      described_class.github_api
      Github.should_receive(:new).exactly(0).times
      described_class.github_api
    end
  end
end # GithubCLI::API

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
github_cli-0.1.2 spec/github_cli/api_spec.rb
github_cli-0.1.1 spec/github_cli/api_spec.rb
github_cli-0.1.0 spec/github_cli/api_spec.rb