Sha256: 52cdab4dcb1e95bdac16a1e584a2f464dc9c1319366938734e760231cd1d322f

Contents?: true

Size: 1.44 KB

Versions: 4

Compression:

Stored size: 1.44 KB

Contents

# encoding: utf-8

require 'spec_helper'

describe GithubCLI::Commands::Authorizations do
  let(:format) { {'format' => 'table'} }
  let(:id) { 1 }
  let(:api_class) { GithubCLI::Authorization }

  it "invokes auth:list" do
    api_class.should_receive(:all).with({}, format)
    subject.invoke "auth:list", []
  end

  it "invokes auth:get" do
    api_class.should_receive(:get).with(id, {}, format)
    subject.invoke "auth:get", [id]
  end

  it "invokes auth:create --scopes --note --note_url" do
    api_class.should_receive(:create).with({"scopes" => ["repo"],
      "note" => "github_cli",
      "note_url" => "https://github.com/peter-murach/github_cli"}, format)
    subject.invoke "auth:create", [], :scopes => ["repo"], :note => 'github_cli', :note_url => "https://github.com/peter-murach/github_cli"
  end

  it "invokes auth:update" do
    api_class.should_receive(:update).with(id, {}, format)
    subject.invoke "auth:update", [id]
  end

  it "invokes auth:update --scopes --note --note_url" do
    api_class.should_receive(:update).with(id, {"scopes" => ["repo"],
      "note" => "github_cli",
      "note_url" => "https://github.com/peter-murach/github_cli"}, format)
    subject.invoke "auth:update", [id], :scopes => ["repo"], :note => 'github_cli', :note_url => "https://github.com/peter-murach/github_cli"
  end

  it "invokes auth:delete" do
    api_class.should_receive(:delete).with(id, {}, format)
    subject.invoke "auth:delete", [id]
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
github_cli-0.6.2 spec/github_cli/commands/authorizations_spec.rb
github_cli-0.6.1 spec/github_cli/commands/authorizations_spec.rb
github_cli-0.6.0 spec/github_cli/commands/authorizations_spec.rb
github_cli-0.5.9 spec/github_cli/commands/authorizations_spec.rb