Sha256: 440b658fc03e4902b728d7072059db09ccf83e3647756ed8c218ec83b131bb04

Contents?: true

Size: 1.25 KB

Versions: 5

Compression:

Stored size: 1.25 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 "should return 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)
        conversion.call(5,packet,packet.buffer).should eql 5
      end
    end

    describe "to_s" do
      it "should return the conversion and packet_log_writer_name" do
        conversion = NewPacketLogConversion.new('BOB')
        conversion.to_s.should eql "NewPacketLogConversion (BOB)"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cosmos-3.2.1 spec/conversions/new_packet_log_conversion_spec.rb
cosmos-3.2.0 spec/conversions/new_packet_log_conversion_spec.rb
cosmos-3.1.2 spec/conversions/new_packet_log_conversion_spec.rb
cosmos-3.1.1 spec/conversions/new_packet_log_conversion_spec.rb
cosmos-3.1.0 spec/conversions/new_packet_log_conversion_spec.rb