Sha256: 33b1a78c9e5efc674e6007ba9926faee5ce67fe68400f531f8f78cb8b49eddf4

Contents?: true

Size: 764 Bytes

Versions: 46

Compression:

Stored size: 764 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe ErbGenerator do
  context '#compile' do
    it 'needs a source and a target' do
      data = double('binding')
      allow(data).to receive(:instance_binding) do
        Class.new do
          def pid_file
            '/path/pid_file'
          end

          def instance_binding
            binding
          end
        end.new.instance_binding
      end

      source = double('source')
      allow(source).to receive(:encoding)
      allow(source).to receive(:read).and_return('Path <%= pid_file %>')

      destination = double('destination')
      expect(destination).to receive(:puts).with('Path /path/pid_file')

      gen = ErbGenerator.new(data)
      gen.compile(source, destination)
    end
  end
end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
local_pac-0.10.0 spec/erb_generator_spec.rb
local_pac-0.9.0 spec/erb_generator_spec.rb
local_pac-0.7.0 spec/erb_generator_spec.rb
local_pac-0.6.3 spec/erb_generator_spec.rb
local_pac-0.6.2 spec/erb_generator_spec.rb
local_pac-0.6.1 spec/erb_generator_spec.rb
local_pac-0.5.0 spec/erb_generator_spec.rb
local_pac-0.4.0 spec/erb_generator_spec.rb
local_pac-0.3.0 spec/erb_generator_spec.rb
local_pac-0.2.3 spec/erb_generator_spec.rb
local_pac-0.2.2 spec/erb_generator_spec.rb
local_pac-0.2.1 spec/erb_generator_spec.rb
local_pac-0.2.0 spec/erb_generator_spec.rb
local_pac-0.1.13 spec/erb_generator_spec.rb
local_pac-0.1.11 spec/erb_generator_spec.rb
local_pac-0.1.10 spec/erb_generator_spec.rb
local_pac-0.1.9 spec/erb_generator_spec.rb
local_pac-0.1.8 spec/erb_generator_spec.rb
local_pac-0.1.7 spec/erb_generator_spec.rb
local_pac-0.1.6 spec/erb_generator_spec.rb