Sha256: a6e7b5ffeb804a0eb456d1b48d7c5067168e5fdf266b4039ce5319ed01f27f7d

Contents?: true

Size: 669 Bytes

Versions: 6

Compression:

Stored size: 669 Bytes

Contents

require 'rubygems'
require 'test-unit'
require 'uri'
require 'http/cookie'

module Enumerable
  def combine
    masks = inject([[], 1]){|(ar, m), e| [ar << m, m << 1 ] }[0]
    all = masks.inject(0){ |al, m| al|m }

    result = []
    for i in 1..all do
      tmp = []
      each_with_index do |e, idx|
        tmp << e unless (masks[idx] & i) == 0
      end
      result << tmp
    end
    result
  end
end

module Test::Unit::Assertions
  def assert_raises_with_message(exc, re, message = nil, &block)
    e = nil
    begin
      block.call
    rescue Exception => e
    end
    assert_instance_of(exc, e, message)
    assert_match(re, e.message, message)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
http-cookie-1.0.0.pre1 test/helper.rb
http-cookie-0.1.5 test/helper.rb
http-cookie-0.1.4 test/helper.rb
http-cookie-0.1.2 test/helper.rb
http-cookie-0.1.1 test/helper.rb
http-cookie-0.1.0 test/helper.rb