Sha256: e68b1057f37f87186e935121a39fc6fdfd4b0b2bfe74e5520d538e39ed57e870

Contents?: true

Size: 988 Bytes

Versions: 9

Compression:

Stored size: 988 Bytes

Contents

# encoding: utf-8

describe Wice::GridOutputBuffer do
  FILTER_COMMON_CODE = 'here filter code'


  let(:buffer){Wice::GridOutputBuffer.new}

  it 'should to_s' do
    expect(buffer.to_s.class).to eq(ActiveSupport::SafeBuffer)
  end

  it 'should add_filter' do

    expect(buffer.add_filter('key', FILTER_COMMON_CODE)).to eq(FILTER_COMMON_CODE)
  end

  it 'should filter_for' do

    buffer.add_filter('key', FILTER_COMMON_CODE)
    expect(buffer.filter_for('key')).to eq(FILTER_COMMON_CODE)
  end

  it 'should filter_for 2 times' do
    buffer.add_filter('key', FILTER_COMMON_CODE)

    expect(buffer.filter_for('key')).to eq(FILTER_COMMON_CODE)
    expect { buffer.filter_for('key') }.to raise_error
  end

  it 'should filter_for without filters' do

    expect { buffer.filter_for('key') }.to raise_error
  end

  it 'should filter_for return empty string' do
    buffer.return_empty_strings_for_nonexistent_filters = true

    expect(buffer.filter_for('key')).to eq('')
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
wice_grid_ms-3.6.2 spec/wice/grid_output_buffer_spec.rb
wice_grid_ms-3.6.1 spec/wice/grid_output_buffer_spec.rb
wice_grid_ms-3.6.0 spec/wice/grid_output_buffer_spec.rb
wice_grid-3.6.0 spec/wice/grid_output_buffer_spec.rb
wice_grid-3.6.0.pre5 spec/wice/grid_output_buffer_spec.rb
wice_grid-3.6.0.pre4 spec/wice/grid_output_buffer_spec.rb
wice_grid-3.6.0.pre3 spec/wice/grid_output_buffer_spec.rb
wice_grid-3.6.0.pre2 spec/wice/grid_output_buffer_spec.rb
wice_grid-3.6.0.pre1 spec/wice/grid_output_buffer_spec.rb