Sha256: b5c2f6d4f47610d7b50c6bd0507d5b9b24def7c5dd5eea3e18a2154ef2c473bc

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

module Pacto
  describe ERBProcessor do
    subject(:processor) { ERBProcessor.new }

    describe '#process' do
      let(:erb) { '2 + 2 = <%= 2 + 2 %>' }
      let(:result) { '2 + 2 = 4' }

      it 'returns the result of ERB' do
        expect(processor.process(erb)).to eq result
      end

      it 'logs the erb processed' do
        Pacto.configuration.logger.should_receive(:debug).with("Processed contract: \"#{result}\"")
        processor.process erb
      end

      it 'does not mess with pure JSONs' do
        processor.process('{"property": ["one", "two, null"]}')
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pacto-0.3.1 spec/unit/pacto/erb_processor_spec.rb