Sha256: 81cb5fcc011c89ae64caa84083f504c7a9fb45f319f9d83209de232bc367d9ea

Contents?: true

Size: 575 Bytes

Versions: 20

Compression:

Stored size: 575 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.as_null_object
      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

20 entries across 20 versions & 1 rubygems

Version Path
github_cli-0.5.9 spec/github_cli/api_spec.rb
github_cli-0.5.8 spec/github_cli/api_spec.rb
github_cli-0.5.7 spec/github_cli/api_spec.rb
github_cli-0.5.6 spec/github_cli/api_spec.rb
github_cli-0.5.5 spec/github_cli/api_spec.rb
github_cli-0.5.4 spec/github_cli/api_spec.rb
github_cli-0.5.3 spec/github_cli/api_spec.rb
github_cli-0.5.2 spec/github_cli/api_spec.rb
github_cli-0.5.1 spec/github_cli/api_spec.rb
github_cli-0.5.0 spec/github_cli/api_spec.rb
github_cli-0.4.4 spec/github_cli/api_spec.rb
github_cli-0.4.3 spec/github_cli/api_spec.rb
github_cli-0.4.2 spec/github_cli/api_spec.rb
github_cli-0.4.1 spec/github_cli/api_spec.rb
github_cli-0.4.0 spec/github_cli/api_spec.rb
github_cli-0.3.1 spec/github_cli/api_spec.rb
github_cli-0.3.0 spec/github_cli/api_spec.rb
github_cli-0.2.1 spec/github_cli/api_spec.rb
github_cli-0.2.0 spec/github_cli/api_spec.rb
github_cli-0.1.3 spec/github_cli/api_spec.rb