Sha256: f25fdc1ab0f317229c0aeb57ada7254ef6e1d1aa5344890d0262b11a768b0f2f

Contents?: true

Size: 1019 Bytes

Versions: 12

Compression:

Stored size: 1019 Bytes

Contents

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(Wice::WiceGridException)
  end

  it 'should filter_for without filters' do

    expect { buffer.filter_for('key') }.to raise_error(Wice::WiceGridException)
  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

12 entries across 12 versions & 2 rubygems

Version Path
wice_grid-6.1.3 spec/wice/grid_output_buffer_spec.rb
wice_grid-6.1.2 spec/wice/grid_output_buffer_spec.rb
wice_grid-6.1.1 spec/wice/grid_output_buffer_spec.rb
wice_grid-6.1.0 spec/wice/grid_output_buffer_spec.rb
pwice_grid-7.0.0 spec/wice/grid_output_buffer_spec.rb
pwice_grid-6.1.2 spec/wice/grid_output_buffer_spec.rb
pwice_grid-6.1.1 spec/wice/grid_output_buffer_spec.rb
pwice_grid-6.1.0 spec/wice/grid_output_buffer_spec.rb
pwice_grid-5.0.2 spec/wice/grid_output_buffer_spec.rb
pwice_grid-5.0.1 spec/wice/grid_output_buffer_spec.rb
pwice_grid-5.0.0 spec/wice/grid_output_buffer_spec.rb
wice_grid-4.1.0 spec/wice/grid_output_buffer_spec.rb