Sha256: 09ef9a803d5094122d682b5ebe919ce77797d88cfdae37243000fe9fd09efaa5

Contents?: true

Size: 999 Bytes

Versions: 34

Compression:

Stored size: 999 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe Actions::CreateOutput do
  context '#initialize' do
    it 'requires template, data and output' do
      output = double('IO')
      repository = double('TemplateRepository')
      data = double('Data')

      engine_klass = Class.new do
        def initialize(data)
        end

        def compile(template, destination)
        end
      end

      Actions::CreateOutput.new(:template, output, data, engine_klass, repository)
    end
  end

  context '#run' do
    it 'runs the action' do
      output = double('$stdout')

      repository = double('TemplateRepository')
      expect(repository).to receive(:find).with(:template)

      data = double('Data')

      engine_klass = Class.new do
        def initialize(data)
        end

        def compile(template, destination)
        end
      end

      silence(:stderr) do
        Actions::CreateOutput.new(:template, output, data, engine_klass, repository).run
      end
    end

  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
proxy_tester-0.1.10 spec/actions/create_output_spec.rb
proxy_tester-0.1.8 spec/actions/create_output_spec.rb
proxy_tester-0.1.6 spec/actions/create_output_spec.rb
proxy_tester-0.1.5 spec/actions/create_output_spec.rb
proxy_tester-0.1.4 spec/actions/create_output_spec.rb
proxy_tester-0.1.3 spec/actions/create_output_spec.rb
proxy_tester-0.1.2 spec/actions/create_output_spec.rb
proxy_tester-0.1.1 spec/actions/create_output_spec.rb
proxy_tester-0.1.0 spec/actions/create_output_spec.rb
proxy_tester-0.0.9 spec/actions/create_output_spec.rb
proxy_tester-0.0.8 spec/actions/create_output_spec.rb
proxy_tester-0.0.7 spec/actions/create_output_spec.rb
proxy_tester-0.0.6 spec/actions/create_output_spec.rb
proxy_tester-0.0.5 spec/actions/create_output_spec.rb
proxy_tester-0.0.4 spec/actions/create_output_spec.rb
proxy_tester-0.0.3 spec/actions/create_output_spec.rb
proxy_tester-0.0.2 spec/actions/create_output_spec.rb
proxy_tester-0.0.1 spec/actions/create_output_spec.rb
local_pac-0.10.2 spec/actions/create_output_spec.rb
local_pac-0.10.1 spec/actions/create_output_spec.rb