Sha256: 86ed5b5b5be25873956ff020ea940d7c2903cfc031e9c6eaef9da5b0f8efa80a

Contents?: true

Size: 1.44 KB

Versions: 59

Compression:

Stored size: 1.44 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/received_time_seconds_conversion'
require 'cosmos/packets/packet'

module Cosmos

  describe ReceivedTimeSecondsConversion do

    describe "initialize" do
      it "initializes converted_type and converted_bit_size" do
        gc = ReceivedTimeSecondsConversion.new()
        expect(gc.converted_type).to eql :FLOAT
        expect(gc.converted_bit_size).to eql 64
      end
    end

    describe "call" do
      it "returns the formatted packet time" do
        gc = ReceivedTimeSecondsConversion.new()
        packet = Packet.new("TGT","PKT")
        time = Time.new(2020,1,31,12,15,30)
        packet.received_time = time
        expect(gc.call(nil,packet,nil)).to eql time.to_f
      end

      it "returns 0.0 if packet time isn't set" do
        gc = ReceivedTimeSecondsConversion.new()
        packet = Packet.new("TGT","PKT")
        expect(gc.call(nil,packet,nil)).to eql 0.0
      end
    end

    describe "to_s" do
      it "returns the class" do
        expect(ReceivedTimeSecondsConversion.new().to_s).to eql "ReceivedTimeSecondsConversion"
      end
    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

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