Sha256: 032adbc3b34a8882d6a243ecb8937f60092dc589baacad23c25b4f26acabb712

Contents?: true

Size: 648 Bytes

Versions: 5

Compression:

Stored size: 648 Bytes

Contents

require 'spec_helper'
require 'anvil/task/naming'

describe Anvil::Task::Callback do

  subject(:callback) { Anvil::Task::Callback.new(:dummy, option: 'value') }

  describe '#new' do
    it 'sets the task by the name' do
      expect(callback.task).to be DummyTask
    end

    it 'sets the options' do
      expect(callback.options).to include(option: 'value')
    end
  end

  describe '.run' do
    let(:dummy_task) { DummyTask.new }

    it 'runs the task' do
      expect(DummyTask).to receive(:new)
        .with(option: 'value')
        .and_return(dummy_task)
      expect(dummy_task).to receive(:run)
      callback.run
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
anvil-core-0.6.0 spec/lib/anvil/task/callback_spec.rb
anvil-core-0.5.0 spec/lib/anvil/task/callback_spec.rb
anvil-core-0.4.2 spec/lib/anvil/task/callback_spec.rb
anvil-core-0.4.1 spec/lib/anvil/task/callback_spec.rb
anvil-core-0.4.0 spec/lib/anvil/task/callback_spec.rb