Sha256: 114933e3a124bf13f19a2f60dfd766b51d2b6f617bb9d2f12519d0fd10a888d0

Contents?: true

Size: 912 Bytes

Versions: 3

Compression:

Stored size: 912 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe GithubCLI::Commands::Forks do
  let(:format) { {'format' => 'table'} }
  let(:user)   { 'peter-murach' }
  let(:repo)   { 'github_cli' }
  let(:api_class) { GithubCLI::Fork }

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

  it "invokes fork:list --sort" do
    api_class.should_receive(:all).with(user, repo, {'sort' => 'newest'}, format)
    subject.invoke "fork:list", [user, repo], :sort => 'newest'
  end

  it "invokes fork:create" do
    api_class.should_receive(:create).with(user, repo, {}, format)
    subject.invoke "fork:create", [user, repo]
  end

  it "invokes fork:create --org" do
    api_class.should_receive(:create).with(user, repo, {'organization' => 'rails'}, format)
    subject.invoke "fork:create", [user, repo], :org => 'rails'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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