Sha256: bad8f9176df396604b7221c94e561f6c9d69f99585f380024dd6d3f8ad653293

Contents?: true

Size: 749 Bytes

Versions: 3

Compression:

Stored size: 749 Bytes

Contents

require 'test/test_helper'

class TestPayload < ActiveSupport::TestCase
  setup do
  end

  test "to_hash" do
    payload = NFAgent::Payload.new do |p|
      p.data = "data"
      p.checksum = "checksum"
      p.line_count = 10
      p.chunk_expired = false
    end
    assert_equal({ 'payload' => 'data', 'checksum' => 'checksum', 'line_count' => 10, 'chunk_expired' => false }, payload.to_hash)
    # Check key
    payload = NFAgent::Payload.new do |p|
      p.data = "data"
      p.checksum = "checksum"
      p.line_count = 10
      p.chunk_expired = false
      p.key = '1234'
    end
    assert_equal({ 'payload' => 'data', 'checksum' => 'checksum', 'line_count' => 10, 'chunk_expired' => false, 'key' => '1234' }, payload.to_hash)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nfagent-0.9.27 test/test_payload.rb
nfagent-0.9.26 test/test_payload.rb
nfagent-0.9.20 test/test_payload.rb