Sha256: 4122ea4c097519e3061b021bbd4c7497516e78e7c3e5a5573934306e6eb08ae9

Contents?: true

Size: 1.24 KB

Versions: 59

Compression:

Stored size: 1.24 KB

Contents

# encoding: ascii-8bit

# Copyright 2014 Ball Aerospace & Technologies Corp.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
# under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.txt

require 'spec_helper'
require 'cosmos/conversions/new_packet_log_conversion'
require 'cosmos/packets/packet'

module Cosmos

  describe NewPacketLogConversion do

    describe "call" do
      it "returns the value given and call start_logging" do
        cmd_tlm_server = double("CmdTlmServer", :packet_logging => '')
        allow(CmdTlmServer).to receive(:instance).and_return(cmd_tlm_server)
        expect(cmd_tlm_server).to receive(:start_logging).with('ALL')
        conversion = NewPacketLogConversion.new('ALL')
        packet = Packet.new("TGT","PKT")
        packet.append_item("TIME",32,:UINT)
        expect(conversion.call(5,packet,packet.buffer)).to eql 5
      end
    end

    describe "to_s" do
      it "returns the conversion and packet_log_writer_name" do
        conversion = NewPacketLogConversion.new('BOB')
        expect(conversion.to_s).to eql "NewPacketLogConversion (BOB)"
      end
    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
cosmos-4.5.2-java spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.5.2 spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.5.1-java spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.5.1 spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.5.0-java spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.5.0 spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.4.2-java spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.4.2 spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.4.1-java spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.4.1 spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.4.0-java spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.4.0 spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.3.0-java spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.3.0 spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.2.4-java spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.2.4 spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.2.3-java spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.2.3 spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.2.2-java spec/conversions/new_packet_log_conversion_spec.rb
cosmos-4.2.2 spec/conversions/new_packet_log_conversion_spec.rb