Sha256: 9313874436a232524852233f1eb30044b86f0f95f34609371405305e038445c9

Contents?: true

Size: 941 Bytes

Versions: 2

Compression:

Stored size: 941 Bytes

Contents

require 'spec_helper'
require 'turnip_formatter/printer/step_extra_args'

module TurnipFormatter::Printer
  describe StepExtraArgs do
    context 'Turnip::Table' do
      describe '.print_out' do
        let(:string) do
          ::Turnip::Table.new([
              ["State", "Money"],
              ["<Tokushima>", "555"],
              ["<Okinawa>", "368"]
            ])
        end

        subject { StepExtraArgs.print_out([string]) }

        it { should match %r{<td>State</td>[[:space:]]+<td>Money</td>} }
        it { should match %r{<td>&lt;Tokushima&gt;</td>[[:space:]]+<td>555</td>} }
        it { should match %r{<td>&lt;Okinawa&gt;</td>[[:space:]]+<td>368</td>} }
      end
    end

    context 'String' do
      describe '.print_out' do
        let(:string) { 'a<a>a' }
        subject { StepExtraArgs.print_out([string]) }
        it { should include '<pre class="multiline">a&lt;a&gt;a</pre>' }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
turnip_formatter-0.2.3 spec/turnip_formatter/printer/step_extra_args_spec.rb
turnip_formatter-0.2.2 spec/turnip_formatter/printer/step_extra_args_spec.rb