Sha256: 3be22a456504b49d97b18c6fef5696df46272fc854ca271de2d6f16a73e3a5cb

Contents?: true

Size: 1.57 KB

Versions: 3

Compression:

Stored size: 1.57 KB

Contents

# encoding: utf-8

require 'spec_helper'

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

  it "invokes milestone:list" do
    api_class.should_receive(:all).with(user, repo,
      {"state"=>"open", "sort"=>"due_date", "direction"=>"desc"}, format)
    subject.invoke "milestone:list", [user, repo]
  end

  it "invokes milestone:list --state" do
    api_class.should_receive(:all).with(user, repo,
      {"state"=>"closed", "sort"=>"due_date", "direction"=>"desc"}, format)
    subject.invoke "milestone:list", [user, repo], :state => "closed"
  end

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

  it "invokes milestone:create --title" do
    api_class.should_receive(:create).with(user, repo, {"title" => 'new'}, format)
    subject.invoke "milestone:create", [user, repo], :title => 'new'
  end

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

  it "invokes milestone:update --title" do
    api_class.should_receive(:update).with(user, repo, 1, {'title' => 'new'}, format)
    subject.invoke "milestone:update", [user, repo, 1], :title => 'new'
  end

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

Version data entries

3 entries across 3 versions & 1 rubygems

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