Sha256: 281cd82534305a6caee70a041e41f16c385d6ac1e1df53e75b67c7522334529f

Contents?: true

Size: 782 Bytes

Versions: 6

Compression:

Stored size: 782 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe GithubCLI::Commands::Commits do
  let(:format) { 'table' }
  let(:user)   { 'peter-murach' }
  let(:repo)   { 'github_cli' }
  let(:sha)    { '3a0f86fb8db8eea7ccbb9a95f325ddbedfb25e15' }
  let(:api_class) { GithubCLI::Commit }

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

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

  it "invokes commit:create --tree" do
    api_class.should_receive(:create).with(user, repo, {"tree" => sha}, format)
    subject.invoke "commit:create", [user, repo], :tree => sha
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
github_cli-0.5.9 spec/github_cli/commands/commits_spec.rb
github_cli-0.5.8 spec/github_cli/commands/commits_spec.rb
github_cli-0.5.7 spec/github_cli/commands/commits_spec.rb
github_cli-0.5.6 spec/github_cli/commands/commits_spec.rb
github_cli-0.5.5 spec/github_cli/commands/commits_spec.rb
github_cli-0.5.4 spec/github_cli/commands/commits_spec.rb