Sha256: 498fd9cb770f0f8fbe9cbc93b3aa1dea93a244e35e8a3b358f5219d6d242df55

Contents?: true

Size: 789 Bytes

Versions: 2

Compression:

Stored size: 789 Bytes

Contents

def request_fixture(binary_path)
  data = File.open(File.dirname(__FILE__) + '/../fixtures/request/' + binary_path, 'rb').read
  data.force_encoding('ASCII-8BIT') if data.respond_to?(:force_encoding)
  data
end

def object_fixture(binary_path)
  data = File.open(File.dirname(__FILE__) + '/../fixtures/objects/' + binary_path, 'rb').read
  data.force_encoding('ASCII-8BIT') if data.respond_to?(:force_encoding)
  data
end

def first_request_eq(object_fixture, value)
  input  = object_fixture(object_fixture)
  output = RocketAMF.deserialize(input)

  request = output[:requests][0]

  expect(request).to eq(value)
end

def get_first_request(object_fixture)
  input  = object_fixture(object_fixture)
  output = RocketAMF.deserialize(input)

  requests = output[:requests]
  requests[0]
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mrpin-rocketamf-2.0.1 spec/helpers/fixtures.rb
mrpin-rocketamf-2.0.0 spec/helpers/fixtures.rb