File: settings_spec.rb

package info (click to toggle)
ruby-amq-protocol 2.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 520 kB
  • sloc: ruby: 5,225; python: 248; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 668 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require "amq/settings"

RSpec.describe AMQ::Settings do
  describe ".default" do
    it "should provide some default values" do
      expect(AMQ::Settings.default).to_not be_nil
      expect(AMQ::Settings.default[:host]).to_not be_nil
    end
  end

  describe ".configure(&block)" do
    it "should merge custom settings with default settings" do
      settings = AMQ::Settings.configure(:host => "tagadab")
      expect(settings[:host]).to eql("tagadab")
    end

    it "should merge custom settings from AMQP URL with default settings" do
      settings = AMQ::Settings.configure("amqp://tagadab")
      expect(settings[:host]).to eql("tagadab")
    end
  end
end