Sha256: 6028f37d8ff38d13ae274401bae9c86377982c95748bdf47908652e1df922979

Contents?: true

Size: 1.26 KB

Versions: 37

Compression:

Stored size: 1.26 KB

Contents

# encoding: utf-8

require "spec_helper"

describe AMQP::Channel, "#auto_recovery" do

  #
  # Environment
  #

  include EventedSpec::AMQPSpec
  include EventedSpec::SpecHelper


  default_options AMQP_OPTS
  default_timeout 2


  it "switches automatic recovery mode on" do
    ch = AMQP::Channel.new(AMQP.connection)
    ch.auto_recovery.should be_false
    ch.auto_recovery = true
    ch.auto_recovery.should be_true
    ch.auto_recovery = false
    ch.auto_recovery.should be_false

    done
  end
end




describe AMQP::Channel, "options hash" do

  #
  # Environment
  #

  include EventedSpec::AMQPSpec
  include EventedSpec::SpecHelper


  default_options AMQP_OPTS
  default_timeout 2


  it "can be passed as the 3rd constructor argument" do
    ch = AMQP::Channel.new(AMQP.connection, AMQP::Channel.next_channel_id, :auto_recovery => true)
    ch.auto_recovery.should be_true
    ch.auto_recovery = false
    ch.auto_recovery.should be_false

    done
  end


  it "can be passed as the 2nd constructor argument" do
    ch = AMQP::Channel.new(AMQP.connection, :auto_recovery => true)
    ch.auto_recovery.should be_true
    ch.should be_auto_recovering
    ch.auto_recovery = false
    ch.auto_recovery.should be_false
    ch.should_not be_auto_recovering

    done
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
amqp-1.0.0.pre1 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.9.5 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.9.4 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.9.3 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.9.2 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.9.1 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.9.0 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.9.0.pre3 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.9.0.pre2 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.9.0.pre1 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.8.4 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.8.3 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.8.2 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.8.1 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.8.0 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.8.0.rc15 spec/integration/automatic_recovery_predicate_spec.rb
amqp-0.8.0.rc14 spec/integration/automatic_recovery_predicate_spec.rb