Sha256: 85a5d64de90ea68f9d8537dacda713e5634faa4020d4a3a54ebf2406f6fa4766

Contents?: true

Size: 1.48 KB

Versions: 1

Compression:

Stored size: 1.48 KB

Contents

        
module Test::Unit::Assertions


   def assert_false(boolean, message=nil)
        _wrap_assertion do
          assert_block("assert should not be called with a block.") { !block_given? }
          assert_block(build_message(message, "<?> is not false.", boolean)) { !boolean }
        end
      end


     def compareArrays( expectArray, actualArray)
             result = true
             expectArray.each_with_index do |element,i|
                 #puts "Comparing #{element} #{element.class} with #{actualArray[i]} #{actualArray[i].class} "
                 if element != actualArray[i]
                     result = false
                     break
                 end
            end  

        return result

    end

    def assert_arrayEquals(expectArray, actualArray, message = nil )
        _wrap_assertion do
          assert_block("assert should not be called with a block.") { !block_given? }
          assert_equal(expectArray.length, actualArray.length, "Lengths did not match")

          assert_block("contents are different." ){  compareArrays( expectArray, actualArray)  }
       end  #_wrap
    end #def


    def assert_arrayContains(array, string , message =nil)

         _wrap_assertion do
          assert_block("assert should not be called with a block.") { !block_given? }
          assert(array.kind_of?(Array) , "Must have an array")
          assert(array.include?(string) , message)
        end
    end

end # module test

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir-1.4.1 watir/testUnitAddons.rb