Sha256: e0e98ff32c4aa1c00442acdafe299b14ae936ac50f15498cc8bd97eb044f7be2

Contents?: true

Size: 984 Bytes

Versions: 1

Compression:

Stored size: 984 Bytes

Contents

require "spec_helper"

describe "configuration" do
  describe "on_message_too_long" do
    it "should default to :raise_error" do
      Mblox.reset_configuration
      expect(Mblox.config.on_message_too_long).to eq(:raise_error)
    end

    it "should allow the value :truncate" do
      expect { Mblox.config.on_message_too_long = :truncate }.to_not raise_error
    end

    it "should allow the value :split" do
      expect { Mblox.config.on_message_too_long = :split }.to_not raise_error
    end

    it "should allow the value :raise_error" do
      expect { Mblox.config.on_message_too_long = :raise_error }.to_not raise_error
    end

    it "should not allow other values and should remain in a valid state" do
      expect { Mblox.config.on_message_too_long = :do_nothing }.to raise_error(ArgumentError, "Mblox.config.on_message_too_long must be either :truncate, :split or :raise_error")
      expect(Mblox.config.on_message_too_long).to eq(:raise_error)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mblox-0.0.3 spec/configuration_spec.rb