Sha256: fa358b9a649c51a39169641548de4f13af31ff9a5b340b5c9eadfbc534de4cb1

Contents?: true

Size: 1019 Bytes

Versions: 1

Compression:

Stored size: 1019 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

module RosettaQueue

  describe Filters do

    after(:each) do
      Filters.reset
    end

    describe "#process_receiving" do
      it "should process the passed in message with the defined receiving filter" do
        Filters.define do |f|
          f.receiving {|message| "Foo #{message}"}
        end

        Filters.process_receiving("Bar").should == "Foo Bar"
      end

      it "should return the same message when no filter is defined" do
        Filters.process_receiving("Bar").should == "Bar"
      end
    end


    describe "#process_sending" do
      it "should process the passed in message with the defined sending filter" do
        Filters.define do |f|
          f.sending {|message| "Foo #{message}"}
        end

        Filters.process_sending("Bar").should == "Foo Bar"
      end

      it "should return the same message when no filter is defined" do
        Filters.process_sending("Bar").should == "Bar"
      end
    end



  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bmabey-rosetta_queue-0.3.3 spec/rosetta_queue/filters_spec.rb