Sha256: d026c4f924e39887e77878bdcf2e786e5f7ab08ab4ff7efef1b427ecf73f7319

Contents?: true

Size: 791 Bytes

Versions: 1

Compression:

Stored size: 791 Bytes

Contents

# encoding: UTF-8

require 'spec_helper'

include Rosette::Core::Commands

describe EnqueueCommitCommand do
  let(:repo_name) { 'single_commit' }

  let(:fixture) do
    load_repo_fixture(repo_name) do |config, repo_config|
      config.use_queue('test')
    end
  end

  let(:queue) { Rosette::Queuing::TestQueue::Queue }
  let(:commit_id) { fixture.repo.git('rev-parse HEAD').strip }
  let(:rosette_config) { fixture.config }
  let(:command) do
    EnqueueCommitCommand.new(rosette_config)
      .set_repo_name(repo_name)
      .set_commit_id(commit_id)
  end

  describe '#execute' do
    it 'enqueues the commit' do
      expect { command.execute }.to(
        change { queue.list.size }.from(0).to(1)
      )

      expect(queue.list.first.commit_id).to eq(commit_id)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rosette-core-1.0.1 spec/core/commands/queuing/enqueue_commit_command_spec.rb