This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit 06c9c7001f882823f6269a33191b077f9af4145f
Author: Andrew Stitcher <astitc...@apache.org>
AuthorDate: Fri Aug 4 18:40:47 2023 -0400

    PROTON-2761: [Ruby] use _() to avoid deprecation warnings
---
 ruby/spec/array_spec.rb              |  20 ++--
 ruby/spec/data_spec.rb               | 150 ++++++++++++------------
 ruby/spec/exception_handling_spec.rb |  16 +--
 ruby/spec/hash_spec.rb               |   6 +-
 ruby/spec/message_spec.rb            | 218 +++++++++++++++++------------------
 5 files changed, 205 insertions(+), 205 deletions(-)

diff --git a/ruby/spec/array_spec.rb b/ruby/spec/array_spec.rb
index dda783e98..7d6460a0c 100644
--- a/ruby/spec/array_spec.rb
+++ b/ruby/spec/array_spec.rb
@@ -32,41 +32,41 @@ describe "The extended array type" do
   it "can be created like a normal array" do
     value = []
 
-    value.must_respond_to(:proton_put)
-    value.must_respond_to(:proton_array_header)
-    value.class.must_respond_to(:proton_get)
+    _(value).must_respond_to(:proton_put)
+    _(value).must_respond_to(:proton_array_header)
+    _(value.class).must_respond_to(:proton_get)
   end
 
   it "raises an error when the current object is not a list" do
     @data.string = random_string(128)
     @data.rewind
-    proc { @data.list }.must_raise(TypeError)
+    _{ @data.list }.must_raise(TypeError)
   end
 
   it "can be put into a Data object as a list" do
     @data.list= @list
     result = @data.list
-    result.must_equal(@list)
+    _(result).must_equal(@list)
   end
 
   it "raises an error when the elements of an Array are dissimilar and is put 
into a Data object" do
     value = Qpid::Proton::Types::UniformArray.new(Qpid::Proton::Codec::INT)
     value << random_string(16)
-    proc { @data << value }.must_raise(TypeError)
+    _{ @data << value }.must_raise(TypeError)
   end
 
   it "can be put into a Data object as an undescribed array" do
     @data << @undescribed
     result = @data.array
-    result.must_be_kind_of Qpid::Proton::Types::UniformArray
-    @undescribed.must_equal(result)
+    _(result).must_be_kind_of Qpid::Proton::Types::UniformArray
+    _(@undescribed).must_equal(result)
   end
 
   it "can be put into a Data object as a described array" do
     @data << @described
     result = @data.array
-    @described.must_equal(result)
-    result.must_be_kind_of Qpid::Proton::Types::UniformArray
+    _(@described).must_equal(result)
+    _(result).must_be_kind_of Qpid::Proton::Types::UniformArray
   end
 
 end
diff --git a/ruby/spec/data_spec.rb b/ruby/spec/data_spec.rb
index 041cf014e..696924fa9 100644
--- a/ruby/spec/data_spec.rb
+++ b/ruby/spec/data_spec.rb
@@ -30,32 +30,32 @@ module Qpid
       end
 
       it "can be initialized" do
-        @data.wont_be_nil
+        _(@data).wont_be_nil
       end
 
       it "can hold a null" do
         @data.null = nil
-        @data.null?.must_equal(true)
+        _(@data.null?).must_equal(true)
       end
 
       it "can hold a true boolean" do
         @data.bool = true
-        @data.bool.must_equal(true)
+        _(@data.bool).must_equal(true)
       end
 
       it "can hold a false boolean" do
         @data.bool = false
-        @data.bool.must_equal(false)
+        _(@data.bool).must_equal(false)
       end
 
       it "raises an error on a negative ubyte" do
-        proc {
+        _{
           @data.ubyte = (0 - (rand(127) + 1))
         }.must_raise(RangeError)
       end
 
       it "raises an error on a null ubyte" do
-        proc {
+        _{
           @data.ubyte = nil
         }.must_raise(TypeError)
       end
@@ -63,46 +63,46 @@ module Qpid
       it "can hold an unsigned byte" do
         value = rand(255)
         @data.ubyte = value
-        @data.ubyte.must_equal(value)
+        _(@data.ubyte).must_equal(value)
       end
 
       it "can hold a byte" do
         value = rand(128)
         @data.byte = value
-        @data.byte.must_equal(value)
+        _(@data.byte).must_equal(value)
       end
 
       it "can hold a negative byte" do
         value = 0 - (rand(126) + 1)
         @data.byte = value
-        @data.byte.must_equal(value)
+        _(@data.byte).must_equal(value)
       end
 
       it "raises an error on a negative ushort" do
-        proc {
+        _{
           @data.ushort = (0 - (rand(65535) + 1))
         }.must_raise(RangeError)
       end
 
       it "raises an error on a nil ushort" do
-        proc {
+        _{
           @data.ushort = nil
         }.must_raise(TypeError)
       end
 
       it "can hold a zero unsigned short" do
         @data.ushort = 0
-        @data.ushort.must_equal(0)
+        _(@data.ushort).must_equal(0)
       end
 
       it "can hold an unsigned short" do
         value = rand(2**15) + 1
         @data.ushort = value
-        @data.ushort.must_equal(value)
+        _(@data.ushort).must_equal(value)
       end
 
       it "raises an error on a nil short" do
-        proc {
+        _{
           @data.short = nil
         }.must_raise(TypeError)
       end
@@ -110,28 +110,28 @@ module Qpid
       it "can hold a short" do
         value = rand(2**15) + 1
         @data.short = value
-        @data.short.must_equal(value)
+        _(@data.short).must_equal(value)
       end
 
       it "can hold a zero short" do
         @data.short = 0
-        @data.short.must_equal(0)
+        _(@data.short).must_equal(0)
       end
 
       it "can hold a negative short" do
         value = (0 - (rand(2**15) + 1))
         @data.short = value
-        @data.short.must_equal(value)
+        _(@data.short).must_equal(value)
       end
 
       it "raises an error on a nil uint" do
-        proc {
+        _{
           @data.uint = nil
         }.must_raise(TypeError)
       end
 
       it "raises an error on a negative uint" do
-        proc {
+        _{
           @data.uint = (0 - (rand(2**32) + 1))
         }.must_raise(RangeError)
       end
@@ -139,16 +139,16 @@ module Qpid
       it "can hold an unsigned integer" do
         value = rand(2**32) + 1
         @data.uint = value
-        @data.uint.must_equal(value)
+        _(@data.uint).must_equal(value)
       end
 
       it "can hold a zero unsigned integer" do
         @data.uint = 0
-        @data.uint.must_equal(0)
+        _(@data.uint).must_equal(0)
       end
 
       it "raise an error on a null integer" do
-        proc {
+        _{
           @data.int = nil
         }.must_raise(TypeError)
       end
@@ -156,16 +156,16 @@ module Qpid
       it "can hold an integer" do
         value = rand(2**31) + 1
         @data.int = value
-        @data.int.must_equal(value)
+        _(@data.int).must_equal(value)
       end
 
       it "can hold zero as an integer" do
         @data.int = 0
-        @data.int.must_equal(0)
+        _(@data.int).must_equal(0)
       end
 
       it "raises an error on a null character" do
-        proc {
+        _{
           @data.char = nil
         }.must_raise(TypeError)
       end
@@ -175,51 +175,51 @@ module Qpid
         index = rand(source.length)
         value = source[index,1].bytes.to_a[0]
         @data.char = value
-        @data.char.must_equal(value)
+        _(@data.char).must_equal(value)
       end
 
       it "raises an error on a null ulong" do
-        proc {
+        _{
           @data.ulong = nil
         }.must_raise(TypeError)
       end
 
       it "raises an error on a negative ulong" do
-        proc {
+        _{
           @data.ulong = (0 - (rand(2**63) + 1))
         }.must_raise(RangeError)
       end
 
       it "can have a zero unsigned long" do
         @data.ulong = 0
-        @data.ulong.must_equal(0)
+        _(@data.ulong).must_equal(0)
       end
 
       it "can hold an unsigned long" do
         value = rand(2**63) + 1
         @data.ulong = value
-        @data.ulong.must_equal(value)
+        _(@data.ulong).must_equal(value)
       end
 
       it "raises an error on a null long" do
-        proc {
+        _{
           @data.long = nil
         }.must_raise(TypeError)
       end
 
       it "can have a zero long" do
         @data.long = 0
-        @data.long.must_equal(0)
+        _(@data.long).must_equal(0)
       end
 
       it "can hold a long" do
         value = rand(2**63) + 1
         @data.long = value
-        @data.long.must_equal(value)
+        _(@data.long).must_equal(value)
       end
 
       it "raise an error on a null timestamp" do
-        proc {
+        _{
           @data.timestamp = nil
         }.must_raise(TypeError)
       end
@@ -227,22 +227,22 @@ module Qpid
       it "can handle a negative timestamp" do
         last_year = Time.now - (60*60*24*365)
         @data.timestamp = last_year
-        @data.timestamp.must_equal(last_year.to_i)
+        _(@data.timestamp).must_equal(last_year.to_i)
       end
 
       it "can handle a zero timestamp" do
         @data.timestamp = 0
-        @data.timestamp.must_equal(0)
+        _(@data.timestamp).must_equal(0)
       end
 
       it "can hold a timestamp" do
         next_year = Time.now + (60*60*24*365)
         @data.timestamp = next_year
-        @data.timestamp.must_equal(next_year.to_i)
+        _(@data.timestamp).must_equal(next_year.to_i)
       end
 
       it "raises an error on a null float" do
-        proc {
+        _{
           @data.float = nil
         }.must_raise(TypeError)
       end
@@ -250,22 +250,22 @@ module Qpid
       it "can hold a negative float" do
         value = 0.0 - (1.0 + rand(2.0**15)).to_f
         @data.float = value
-        @data.float.must_equal(value)
+        _(@data.float).must_equal(value)
       end
 
       it "can hold a zero float" do
         @data.float = 0.0
-        @data.float.must_equal(0.0)
+        _(@data.float).must_equal(0.0)
       end
 
       it "can hold a float" do
         value = (1.0 + rand(2.0**15)).to_f
         @data.float = value
-        @data.float.must_equal(value)
+        _(@data.float).must_equal(value)
       end
 
       it "raise an error on a null double" do
-        proc {
+        _{
           @data.double = nil
         }.must_raise(TypeError)
       end
@@ -273,125 +273,125 @@ module Qpid
       it "can hold a negative double" do
         value = 0.0 - (1.0 + rand(2.0**31)).to_f
         @data.double = value
-        @data.double.must_equal(value)
+        _(@data.double).must_equal(value)
       end
 
       it "can hold a zero double" do
         @data.double = 0.0
-        @data.double.must_equal(0.0)
+        _(@data.double).must_equal(0.0)
       end
 
       it "can hold a double" do
         value = (1.0 + rand(2.0**31)).to_f
         @data.double = value
-        @data.double.must_equal(value)
+        _(@data.double).must_equal(value)
       end
 
       it "raises an error on a null decimal32" do
-        proc {
+        _{
           @data.decimal32 = nil
         }.must_raise(TypeError)
       end
 
       it "can hold a zero decimal32" do
         @data.decimal32 = 0
-        @data.decimal32.must_equal(0)
+        _(@data.decimal32).must_equal(0)
       end
 
       it "can hold a decimal32" do
         value = 1 + rand(2**31)
         @data.decimal32 = value
-        @data.decimal32.must_equal(value)
+        _(@data.decimal32).must_equal(value)
       end
 
       it "raises an error on a null decimal64" do
-        proc {
+        _{
           @data.decimal64 = nil
         }.must_raise(TypeError)
       end
 
       it "can hold a zero decimal64" do
         @data.decimal64 = 0
-        @data.decimal64.must_equal(0)
+        _(@data.decimal64).must_equal(0)
       end
 
       it "can hold a decimal64" do
         value = 1 + rand(2**63)
         @data.decimal64 = value
-        @data.decimal64.must_equal(value)
+        _(@data.decimal64).must_equal(value)
       end
 
       it "raises an error on a null decimal128" do
-        proc {
+        _{
           @data.decimal128 = nil
         }.must_raise(TypeError)
       end
 
       it "can hold a zero decimal128" do
         @data.decimal128 = 0
-        @data.decimal128.must_equal(0)
+        _(@data.decimal128).must_equal(0)
       end
 
       it "can hold a decimal128" do
         value = rand(2**127)
         @data.decimal128 = value
-        @data.decimal128.must_equal(value)
+        _(@data.decimal128).must_equal(value)
       end
 
       it "raises an error on a null UUID" do
-        proc {
+        _{
           @data.uuid = nil
         }.must_raise(::ArgumentError)
       end
 
       it "raises an error on a malformed UUID" do
-        proc {
+        _{
           @data.uuid = random_string(36)
         }.must_raise(::ArgumentError)
       end
 
       it "can set a UUID from an integer value" do
         @data.uuid = 336307859334295828133695192821923655679
-        @data.uuid.must_equal("fd0289a5-8eec-4a08-9283-81d02c9d2fff")
+        _(@data.uuid).must_equal("fd0289a5-8eec-4a08-9283-81d02c9d2fff")
       end
 
       it "can hold a UUID" do
         value = "fd0289a5-8eec-4a08-9283-81d02c9d2fff"
         @data.uuid = value
-        @data.uuid.must_equal(value)
+        _(@data.uuid).must_equal(value)
       end
 
       it "can hold a null binary" do
         @data.binary = nil
-        @data.binary.must_equal("")
+        _(@data.binary).must_equal("")
       end
 
       it "can hold a binary" do
         value = random_string(128)
         @data.binary = value
-        @data.binary.must_equal(value)
+        _(@data.binary).must_equal(value)
       end
 
       it "can hold a null string" do
         @data.string = nil
-        @data.string.must_equal("")
+        _(@data.string).must_equal("")
       end
 
       it "can hold a string" do
         value = random_string(128)
         @data.string = value
-        @data.string.must_equal(value)
+        _(@data.string).must_equal(value)
       end
 
       it "can hold a null symbol" do
         @data.symbol = nil
-        @data.symbol.must_equal(:"")
+        _(@data.symbol).must_equal(:"")
       end
 
       it "can hold a symbol" do
         value = random_string(128).to_sym
         @data.symbol = value
-        @data.symbol.must_equal(value)
+        _(@data.symbol).must_equal(value)
       end
 
       it "can hold a described value" do
@@ -403,16 +403,16 @@ module Qpid
         @data.string = value
         @data.exit
 
-        @data.described?.must_equal(true)
+        _(@data.described?).must_equal(true)
         @data.enter
         @data.next
-        @data.symbol.must_equal(name)
+        _(@data.symbol).must_equal(name)
         @data.next
-        @data.string.must_equal(value)
+        _(@data.string).must_equal(value)
       end
 
       it "raises an error when setting the wrong type in an array" do
-        proc {
+        _{
           @data << 
Qpid::Proton::Types::UniformArray.new(Qpid::Proton::Types::INT, [1, 2.0, :a, 
"b"])
         }.must_raise(TypeError)
       end
@@ -428,7 +428,7 @@ module Qpid
         @data.enter
         values.each do |value|
           @data.next
-          @data.int.must_equal(value)
+          _(@data.int).must_equal(value)
         end
       end
 
@@ -442,13 +442,13 @@ module Qpid
         values.each { |value| @data.string = value }
         @data.exit
 
-        @data.get_array.must_equal([values.size, true, 
Qpid::Proton::Codec::STRING.code])
+        _(@data.get_array).must_equal([values.size, true, 
Qpid::Proton::Codec::STRING.code])
         @data.enter
         @data.next
-        @data.symbol.must_equal(descriptor)
+        _(@data.symbol).must_equal(descriptor)
         values.each do |value|
           @data.next
-          @data.string.must_equal(value)
+          _(@data.string).must_equal(value)
         end
       end
 
@@ -463,7 +463,7 @@ module Qpid
         @data.enter
         values.each do |value|
           @data.next
-          @data.string.must_equal(value)
+          _(@data.string).must_equal(value)
         end
       end
 
@@ -484,9 +484,9 @@ module Qpid
         @data.enter
         keys.each do |key|
           @data.next
-          @data.string.must_equal(key)
+          _(@data.string).must_equal(key)
           @data.next
-          @data.string.must_equal(values[key])
+          _(@data.string).must_equal(values[key])
         end
       end
 
diff --git a/ruby/spec/exception_handling_spec.rb 
b/ruby/spec/exception_handling_spec.rb
index 3d65b40a8..fa12e72a7 100644
--- a/ruby/spec/exception_handling_spec.rb
+++ b/ruby/spec/exception_handling_spec.rb
@@ -41,49 +41,49 @@ module Qpid
       end
 
       it "raises EOS on PN_EOS" do
-        proc {
+        _{
           @handler.check_for_error(Qpid::Proton::Error::EOS)
         }.must_raise(Qpid::Proton::EOSError)
       end
 
       it "raises Error on PN_ERR" do
-        proc {
+        _{
           @handler.check_for_error(Qpid::Proton::Error::ERROR)
         }.must_raise(Qpid::Proton::ProtonError)
       end
 
       it "raises Overflow on PN_OVERFLOW" do
-        proc {
+        _{
           @handler.check_for_error(Qpid::Proton::Error::OVERFLOW)
         }.must_raise(Qpid::Proton::OverflowError)
       end
 
       it "raises Underflow on PN_UNDERFLOW" do
-        proc {
+        _{
           @handler.check_for_error(Qpid::Proton::Error::UNDERFLOW)
         }.must_raise(Qpid::Proton::UnderflowError)
       end
 
       it "raises Argument on PN_ARG_ERR" do
-        proc {
+        _{
           @handler.check_for_error(Qpid::Proton::Error::ARGUMENT)
         }.must_raise(Qpid::Proton::ArgumentError)
       end
 
       it "raises TimeoutError on PN_TIMEOUT" do
-        proc {
+        _{
           @handler.check_for_error(Qpid::Proton::Error::TIMEOUT)
         }.must_raise(Qpid::Proton::TimeoutError)
       end
 
       it "raises an Ruby ArgumentError on a nil code" do
-        proc {
+        _{
           @handler.check_for_error(nil)
         }.must_raise(::ArgumentError)
       end
 
       it "raises a Ruby ArgumentError on an unknown value" do
-        proc {
+        _{
           @handler.check_for_error("farkle")
         }.must_raise(::ArgumentError)
       end
diff --git a/ruby/spec/hash_spec.rb b/ruby/spec/hash_spec.rb
index d9e07c185..858b07340 100644
--- a/ruby/spec/hash_spec.rb
+++ b/ruby/spec/hash_spec.rb
@@ -29,15 +29,15 @@ describe "The extended hash type" do
   it "can be put into an instance of Data" do
     @data.map = @hash
     result = @data.map
-    result.keys.must_equal(@hash.keys)
-    result.values.must_equal(@hash.values)
+    _(result.keys).must_equal(@hash.keys)
+    _(result.values).must_equal(@hash.values)
   end
 
   it "raises an error when trying to get what is not a Hash" do
     @data.string = random_string(128)
     @data.rewind
 
-    proc {
+    _{
       @data.map
     }.must_raise(TypeError)
   end
diff --git a/ruby/spec/message_spec.rb b/ruby/spec/message_spec.rb
index 2caf5a3cf..59737e376 100644
--- a/ruby/spec/message_spec.rb
+++ b/ruby/spec/message_spec.rb
@@ -29,38 +29,38 @@ module Qpid
       end
 
       it "can be created" do
-        @message.wont_be_nil
+        _(@message).wont_be_nil
       end
 
       it "can be cleared" do
         subject = random_string(16)
         @message.subject = subject
-        @message.subject.must_equal(subject)
+        _(@message.subject).must_equal(subject)
         @message.clear
-        @message.subject.wont_equal(subject)
+        _(@message.subject).wont_equal(subject)
       end
 
       it "can be durable" do
         @message.durable = true
-        @message.durable.must_equal(true)
+        _(@message.durable).must_equal(true)
         @message.durable = false
-        @message.durable.must_equal(false)
+        _(@message.durable).must_equal(false)
       end
 
       it "raises an error when setting durable to nil" do
-        proc {
+        _{
           @message.durable = nil
         }.must_raise(TypeError)
       end
 
       it "raises an error when setting the priority to nil" do
-        proc {
+        _{
           @message.priority = nil
         }.must_raise(TypeError)
       end
 
       it "raises an error when setting the priority to a non-number" do
-        proc {
+        _{
           @message.priority = "abck"
         }.must_raise(TypeError)
       end
@@ -68,17 +68,17 @@ module Qpid
       it "sets the priority to the integer portion when a float" do
         priority = rand(100) / 10
         @message.priority = priority
-        @message.priority.must_equal(priority.floor)
+        _(@message.priority).must_equal(priority.floor)
       end
 
       it "rejects a priority with too large of a value" do
-        proc {
+        _{
           @message.priority = (rand(100) + 256)
         }.must_raise(RangeError)
       end
 
       it "rejects a negative priority" do
-        proc {
+        _{
           @message.priority = (0 - (rand(255) + 1))
         }.must_raise(RangeError)
       end
@@ -86,17 +86,17 @@ module Qpid
       it "has a priority" do
         priority = rand(256)
         @message.priority = priority
-        @message.priority.must_equal(priority)
+        _(@message.priority).must_equal(priority)
       end
 
       it "raises an error when setting the time-to-live to nil" do
-        proc {
+        _{
           @message.ttl = nil
         }.must_raise(TypeError)
       end
 
       it "raises an error when setting the time-to-live to a non-number" do
-        proc {
+        _{
           @message.ttl = random_string(5)
         }.must_raise(TypeError)
       end
@@ -104,11 +104,11 @@ module Qpid
       it "sets the time-to-live to the integer portion when a float" do
         ttl = (rand(32767) / 10)
         @message.ttl = ttl
-        @message.ttl.must_equal(ttl.floor)
+        _(@message.ttl).must_equal(ttl.floor)
       end
 
       it "raises an error when the time-to-live is negative" do
-        proc {
+        _{
           @message.ttl = (0 - (rand(1000) + 1))
         }.must_raise(RangeError)
       end
@@ -116,43 +116,43 @@ module Qpid
       it "has a time-to-live" do
         ttl = rand(32767)
         @message.ttl = ttl
-        @message.ttl.must_equal(ttl)
+        _(@message.ttl).must_equal(ttl)
       end
 
       it "raises an error when setting first acquirer to nil" do
-        proc {
+        _{
           @message.first_acquirer = nil
         }.must_raise(TypeError)
       end
 
       it "raises and error when setting first acquirer to a non-boolean" do
-        proc {
+        _{
           @message.first_acquirer = random_string(16)
         }.must_raise(TypeError)
       end
 
       it "has a first acquirer" do
         @message.first_acquirer = true
-        @message.first_acquirer?.must_equal(true)
+        _(@message.first_acquirer?).must_equal(true)
 
         @message.first_acquirer = false
-        @message.first_acquirer?.must_equal(false)
+        _(@message.first_acquirer?).must_equal(false)
       end
 
       it "raises an error on a nil delivery count" do
-        proc {
+        _{
           @message.delivery_count = nil
         }.must_raise(::ArgumentError)
       end
 
       it "raises an error on a negative delivery count" do
-        proc {
+        _{
           @message.delivery_count = -1
         }.must_raise(RangeError)
       end
 
       it "raises an error on a non-numeric delivery count" do
-        proc {
+        _{
           @message.delivery_count = "farkle"
         }.must_raise(::ArgumentError)
       end
@@ -160,218 +160,218 @@ module Qpid
       it "converts a floating point delivery count to its integer portion" do
           count = rand(255) / 10.0
           @message.delivery_count = count
-          @message.delivery_count.must_equal(count.floor)
+          _(@message.delivery_count).must_equal(count.floor)
         end
 
       it "has a delivery count" do
         count = rand(255)
         @message.delivery_count = count
-        @message.delivery_count.must_equal(count)
+        _(@message.delivery_count).must_equal(count)
       end
 
       it "allows setting a nil id" do
         @message.id = nil
-        @message.id.must_be_nil
+        _(@message.id).must_be_nil
       end
 
       it "has an id" do
         id = random_string(16)
         @message.id = id
-        @message.id.must_equal(id)
+        _(@message.id).must_equal(id)
       end
 
       it "allows setting a nil user id" do
         @message.user_id = nil
-        @message.user_id.must_equal("")
+        _(@message.user_id).must_equal("")
       end
 
       it "has a user id" do
         id = random_string(16)
         @message.user_id = id
-        @message.user_id.must_equal(id)
+        _(@message.user_id).must_equal(id)
       end
 
       it "allows setting a nil address" do
         @message.address = nil
-        @message.address.must_be_nil
+        _(@message.address).must_be_nil
       end
 
       it "has an address" do
         address = "//0.0.0.0/#{random_string(16)}"
         @message.address = address
-        @message.address.must_equal(address)
+        _(@message.address).must_equal(address)
       end
 
       it "allows setting a nil subject" do
         @message.subject = nil
-        @message.subject.must_be_nil
+        _(@message.subject).must_be_nil
       end
 
       it "has a subject" do
         subject = random_string(50)
         @message.subject = subject
-        @message.subject.must_equal(subject)
+        _(@message.subject).must_equal(subject)
       end
 
       it "will allow a nil reply-to address" do
         @message.reply_to = nil
-        @message.reply_to.must_be_nil
+        _(@message.reply_to).must_be_nil
       end
 
       it "has a reply-to address" do
         address = "//0.0.0.0/#{random_string(16)}"
         @message.reply_to = address
-        @message.reply_to.must_equal(address)
+        _(@message.reply_to).must_equal(address)
       end
 
       it "will allow a nil correlation id" do
         @message.correlation_id = nil
-        @message.correlation_id.must_be_nil
+        _(@message.correlation_id).must_be_nil
       end
 
       it "has a correlation id" do
         id = random_string(25)
         @message.correlation_id = id
-        @message.correlation_id.must_equal(id)
+        _(@message.correlation_id).must_equal(id)
       end
 
       it "will allow a nil content type" do
         @message.content_type = nil
-        @message.content_type.must_be_nil
+        _(@message.content_type).must_be_nil
       end
 
       it "will allow an empty content type" do
         @message.content_type = ""
-        @message.content_type.must_equal("")
+        _(@message.content_type).must_equal("")
       end
 
       it "has a content type" do
         content_type = random_string(32)
         @message.content_type = content_type
-        @message.content_type.must_equal(content_type)
+        _(@message.content_type).must_equal(content_type)
       end
 
       it "can have nil content encoding" do
         @message.content_encoding = nil
-        @message.content_encoding.must_be_nil
+        _(@message.content_encoding).must_be_nil
       end
 
       it "has a content encoding" do
         encoding = "#{random_string(8)}/#{random_string(8)}"
         @message.content_encoding = encoding
-        @message.content_encoding.must_equal(encoding)
+        _(@message.content_encoding).must_equal(encoding)
       end
 
       it "raises an error on a nil expiry time" do
-        proc {
+        _{
           @message.expires = nil
         }.must_raise(TypeError)
       end
 
       it "raises an error on a negative expiry time" do
-        proc {
+        _{
           @message.expires = (0-(rand(65535)))
         }.must_raise(::ArgumentError)
       end
 
       it "can have a zero expiry time" do
         @message.expires = 0
-        @message.expires.must_equal(0)
+        _(@message.expires).must_equal(0)
       end
 
       it "has an expiry time" do
         time = rand(65535)
         @message.expires = time
-        @message.expires.must_equal(time)
+        _(@message.expires).must_equal(time)
       end
 
       it "raises an error on a nil creation time" do
-        proc {
+        _{
           @message.creation_time = nil
         }.must_raise(TypeError)
       end
 
       it "raises an error on a negative creation time" do
-        proc {
+        _{
           @message.creation_time = (0 - rand(65535))
         }.must_raise(::ArgumentError)
       end
 
       it "can have a zero creation time" do
         @message.creation_time = 0
-        @message.creation_time.must_equal(0)
+        _(@message.creation_time).must_equal(0)
       end
 
       it "has a creation time" do
         time = rand(65535)
         @message.creation_time = time
-        @message.creation_time.must_equal(time)
+        _(@message.creation_time).must_equal(time)
       end
 
       it "can have a nil group id" do
         @message.group_id = nil
-        @message.group_id.must_be_nil
+        _(@message.group_id).must_be_nil
       end
 
       it "can have an empty group id" do
         @message.group_id = ""
-        @message.group_id.must_equal("")
+        _(@message.group_id).must_equal("")
       end
 
       it "has a group id" do
         id = random_string(16)
         @message.group_id = id
-        @message.group_id.must_equal(id)
+        _(@message.group_id).must_equal(id)
       end
 
 
       it "raises an error on a nil group sequence" do
-        proc {
+        _{
           @message.group_sequence = nil
         }.must_raise(TypeError)
       end
 
       it "can have a zero group sequence" do
         @message.group_sequence = 0
-        @message.group_sequence.must_equal(0)
+        _(@message.group_sequence).must_equal(0)
       end
 
       it "has a group sequence" do
         id = rand(4294967295)
         @message.group_sequence = id
-        @message.group_sequence.must_equal(id)
+        _(@message.group_sequence).must_equal(id)
       end
 
       it "can have a nil reply-to group id" do
         @message.reply_to_group_id = nil
-        @message.reply_to_group_id.must_be_nil
+        _(@message.reply_to_group_id).must_be_nil
       end
 
       it "can have an empty reply-to group id" do
         @message.reply_to_group_id = ""
-        @message.reply_to_group_id.must_equal("")
+        _(@message.reply_to_group_id).must_equal("")
       end
 
       it "has a reply-to group id" do
         id = random_string(16)
         @message.reply_to_group_id = id
-        @message.reply_to_group_id.must_equal(id)
+        _(@message.reply_to_group_id).must_equal(id)
       end
 
       it "has properties" do
-        @message.must_respond_to(:properties)
-        @message.must_respond_to(:properties=)
-        @message.must_respond_to(:[])
-        @message.must_respond_to(:[]=)
+        _(@message).must_respond_to(:properties)
+        _(@message).must_respond_to(:properties=)
+        _(@message).must_respond_to(:[])
+        _(@message).must_respond_to(:[]=)
 
-        @message.properties.must_be_kind_of({}.class)
+        _(@message.properties).must_be_kind_of({}.class)
       end
 
       it "can replace the set of properties" do
         values = random_hash(128)
 
         @message.properties = values.clone
-        @message.properties.must_equal(values)
+        _(@message.properties).must_equal(values)
       end
 
       it "can set properties" do
@@ -379,7 +379,7 @@ module Qpid
         value = random_string(128)
 
         @message[name] = value
-        @message[name].must_equal(value)
+        _(@message[name]).must_equal(value)
       end
 
       it "can update properties" do
@@ -387,11 +387,11 @@ module Qpid
         value = random_string(128)
 
         @message[name] = value
-        @message[name].must_equal(value)
+        _(@message[name]).must_equal(value)
 
         value = random_string(128)
         @message[name] = value
-        @message[name].must_equal(value)
+        _(@message[name]).must_equal(value)
       end
 
       it "can hold a null property" do
@@ -399,10 +399,10 @@ module Qpid
         value = random_string(128)
 
         @message[name] = value
-        @message[name].must_equal(value)
+        _(@message[name]).must_equal(value)
 
         @message[name] = nil
-        @message[name].must_be_nil
+        _(@message[name]).must_be_nil
       end
 
       it "can delete a property" do
@@ -410,10 +410,10 @@ module Qpid
         value = random_string(128)
 
         @message[name] = value
-        @message[name].must_equal(value)
+        _(@message[name]).must_equal(value)
 
         @message.delete_property(name)
-        @message.properties.keys.wont_include(name)
+        _(@message.properties.keys).wont_include(name)
       end
 
       it "has no properties after being cleared" do
@@ -421,15 +421,15 @@ module Qpid
         value = random_string(128)
 
         @message[name] = value
-        @message[name].must_equal(value)
+        _(@message[name]).must_equal(value)
 
         @message.clear
-        @message.properties.must_be_empty
+        _(@message.properties).must_be_empty
       end
 
       it "has instructions" do
-        @message.must_respond_to(:instructions)
-        @message.must_respond_to("instructions=".to_sym)
+        _(@message).must_respond_to(:instructions)
+        _(@message).must_respond_to("instructions=".to_sym)
       end
 
       it "can set an instruction" do
@@ -437,7 +437,7 @@ module Qpid
         value = random_string(128)
 
         @message.instructions[name] = value
-        @message.instructions[name].must_equal(value)
+        _(@message.instructions[name]).must_equal(value)
       end
 
       it "can update an instruction" do
@@ -445,11 +445,11 @@ module Qpid
         value = random_string(128)
 
         @message.instructions[name] = value
-        @message.instructions[name].must_equal(value)
+        _(@message.instructions[name]).must_equal(value)
 
         value = random_string(128)
         @message.instructions[name] = value
-        @message.instructions[name].must_equal(value)
+        _(@message.instructions[name]).must_equal(value)
       end
 
       it "can delete the instructions" do
@@ -457,47 +457,47 @@ module Qpid
         value = random_string(128)
 
         @message.instructions[name] = value
-        @message.instructions.wont_be_empty
+        _(@message.instructions).wont_be_empty
 
         @message.instructions = nil
-        @message.instructions.must_be_nil
+        _(@message.instructions).must_be_nil
       end
 
       it "can replace the instructions" do
         values = random_hash(rand(128) + 1)
 
         @message.instructions = values.clone
-        @message.instructions.must_equal(values)
+        _(@message.instructions).must_equal(values)
 
         values = random_hash(rand(64) + 1)
 
         @message.instructions = values.clone
-        @message.instructions.must_equal(values)
+        _(@message.instructions).must_equal(values)
       end
 
       it "can delete the set of instructions" do
         values = random_hash(rand(128) + 1)
 
         @message.instructions = values.clone
-        @message.instructions.must_equal(values)
+        _(@message.instructions).must_equal(values)
 
         @message.instructions = nil
-        @message.instructions.must_be_nil
+        _(@message.instructions).must_be_nil
       end
 
       it "has no instructions after being cleared" do
         value = random_hash(128)
 
         @message.instructions = value.clone
-        @message.instructions.must_equal(value)
+        _(@message.instructions).must_equal(value)
 
          @message.clear
-        @message.instructions.must_be_empty
+        _(@message.instructions).must_be_empty
       end
 
       it "has annotations" do
-        @message.must_respond_to(:annotations)
-        @message.must_respond_to(:annotations=)
+        _(@message).must_respond_to(:annotations)
+        _(@message).must_respond_to(:annotations=)
       end
 
       it "can set an annotation" do
@@ -505,7 +505,7 @@ module Qpid
         value = random_hash(256)
 
         @message.annotations[name] = value.clone
-        @message.annotations[name].must_equal(value)
+        _(@message.annotations[name]).must_equal(value)
       end
 
       it "can update an annotation" do
@@ -513,12 +513,12 @@ module Qpid
         value = random_hash(256)
 
         @message.annotations[name] = value.clone
-        @message.annotations[name].must_equal(value)
+        _(@message.annotations[name]).must_equal(value)
 
         value = random_hash(128)
 
         @message.annotations[name] = value.clone
-        @message.annotations[name].must_equal(value)
+        _(@message.annotations[name]).must_equal(value)
       end
 
       it "can delete an annotation" do
@@ -526,61 +526,61 @@ module Qpid
         value = random_hash(256)
 
         @message.annotations[name] = value.clone
-        @message.annotations[name].must_equal(value)
+        _(@message.annotations[name]).must_equal(value)
 
         @message.annotations[name] = nil
-        @message.annotations[name].must_be_nil
+        _(@message.annotations[name]).must_be_nil
       end
 
       it "can replace all annotations" do
         values = random_hash(rand(128) + 1)
 
         @message.annotations = values.clone
-        @message.annotations.must_equal(values)
+        _(@message.annotations).must_equal(values)
 
         values = random_hash(rand(64) + 1)
 
         @message.annotations = values.clone
-        @message.annotations.must_equal(values)
+        _(@message.annotations).must_equal(values)
       end
 
       it "can delete the set of annotations" do
         value = random_hash(rand(128) + 1)
 
         @message.annotations = value.clone
-        @message.annotations.must_equal(value)
+        _(@message.annotations).must_equal(value)
 
         @message.annotations = nil
-        @message.annotations.must_be_nil
+        _(@message.annotations).must_be_nil
       end
 
       it "has no annotations after being cleared" do
         value = random_hash(16)
 
         @message.annotations = value
-        @message.annotations.must_equal(value)
+        _(@message.annotations).must_equal(value)
 
         @message.clear
-        @message.annotations.must_be_empty
+        _(@message.annotations).must_be_empty
       end
 
       it "has a body property" do
-        @message.must_respond_to(:body)
-        @message.must_respond_to(:body=)
+        _(@message).must_respond_to(:body)
+        _(@message).must_respond_to(:body=)
       end
 
       it "has a default body that is nil" do
-        @message.body.must_be_nil
+        _(@message.body).must_be_nil
       end
 
       it "has no body after being cleared" do
         value = random_string(128)
 
         @message.body = value
-        @message.body.must_equal(value)
+        _(@message.body).must_equal(value)
 
         @message.clear
-        @message.body.must_be_nil
+        _(@message.body).must_be_nil
       end
 
       it "can set the body property" do
@@ -597,7 +597,7 @@ module Qpid
           end
 
           @message.body = value
-          @message.body.must_equal(value)
+          _(@message.body).must_equal(value)
         end
       end
 
@@ -615,10 +615,10 @@ module Qpid
           end
 
           @message.body = value
-          @message.body.must_equal(value)
+          _(@message.body).must_equal(value)
 
           @message.body = nil
-          @message.body.must_be_nil
+          _(@message.body).must_be_nil
         end
       end
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org


Reply via email to