Sha256: 869a203f3fbf8316494a2d86a3f8e4cc692ee7597c653767759e8ac91695604f

Contents?: true

Size: 682 Bytes

Versions: 2

Compression:

Stored size: 682 Bytes

Contents

require 'text_utils/spec_helper'

describe "FormatQualifier" do
  before :all do
    class TextProcA < TextUtils::Processor
      def call data, env
        call_next "#{data} a", env
      end
    end

    class TextProcB < TextUtils::Processor
      def initialize processor, text
        super(processor)
        @text = text
      end

      def call data, env
        call_next "#{data} #{@text}", env
      end
    end
  end
  after :all do
    remove_constants :TextProcA, :TextProcB
  end

  before do
    @pipe = TextUtils::Pipe.new \
      TextProcA,
      [TextProcB, 'b']
  end

  it "should qualify :html format" do
    @pipe.call('text').should == "text a b"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rad_kit-0.0.10 spec/text_utils/pipe_spec.rb
rad_kit-0.0.9 spec/text_utils/pipe_spec.rb