Sha256: 735a007d291c54e463a33dfcd1b27a578a1380d79534894cb5406b55d2775580

Contents?: true

Size: 501 Bytes

Versions: 2

Compression:

Stored size: 501 Bytes

Contents

require 'assert/factory'

module Factory
  extend Assert::Factory

  def self.exception(klass = nil, message = nil)
    klass ||= StandardError
    message ||= Factory.text
    exception = nil
    begin; raise(klass, message); rescue klass => exception; end
    exception.set_backtrace(nil) if Factory.boolean
    exception
  end

  def self.protocol_response
    Sanford::Protocol::Response.new(
      [Factory.integer(999), Factory.text],
      { Factory.string => Factory.string }
    )
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sanford-0.18.1 test/support/factory.rb
sanford-0.18.0 test/support/factory.rb