Sha256: 2466798847681b3e521f2e0980f5ba58ee0aaa45ad54bfefb4db1a18a96b990d

Contents?: true

Size: 904 Bytes

Versions: 25

Compression:

Stored size: 904 Bytes

Contents

# ********** Copyright Viacom, Inc. Apache 2.0 **********

require_relative "test_helper.rb"

class ProfilerTest < Minitest::Test
  def test_profiler_stats
    waitfor = Proc.new do |config, &blk|
      assert_equal(/.+/, config["Match"])
      assert_equal(5, config["Timeout"])
      txt = "<All_Nodes><NodeA /><NodeB /><NodeC><NodeD /></NodeC></All_Nodes>\n"
      blk.call(txt)
      true
    end
    connection = Minitest::Mock.new
    device_config = {
      ip: "111.222.333",
      user: "user",
      password: "password",
      logger: Logger.new("/dev/null")
    }
    profiler = RokuBuilder::Profiler.new(**device_config)

    connection.expect(:puts, nil, ["sgnodes all\n"])
    connection.expect(:waitfor, nil, &waitfor)

    Net::Telnet.stub(:new, connection) do
      profiler.stub(:printf, nil) do
        profiler.run(command: :stats)
      end
    end

    connection.verify
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
roku_builder-3.8.4 tests/roku_builder/profiler_test.rb
roku_builder-3.8.3 tests/roku_builder/profiler_test.rb
roku_builder-3.8.2 tests/roku_builder/profiler_test.rb
roku_builder-3.8.1 tests/roku_builder/profiler_test.rb
roku_builder-3.8.0 tests/roku_builder/profiler_test.rb