Sha256: 9f856be317ce4bae3f671c7792839bce7cf903131371844b51e603031ea4142d

Contents?: true

Size: 653 Bytes

Versions: 1

Compression:

Stored size: 653 Bytes

Contents

require 'helper'
require 'claymore/total_hash_rate.rb'

class TotalHashRateTest < Test::Unit::TestCase
  test 'return nil when no match' do
    assert_nil service('ETH: job is the same')
    assert_nil service('ETH: checking pool connection...')
    assert_nil service('ETH: GPU0 29 Mh/s, GPU1 off')
  end

  test 'extracts asset name and total hash rate' do
    line = 'ETH - Total Speed: 90.118 Mh/s, Total Shares: 237, Rejected: 0, Time: 06:50'
    assert_equal ({
      'asset' => 'ETH',
      'hash_rate' => 90.118,
      'type' => 'TOTAL_HASH_RATE'
    }), service(line)
  end

  def service(line)
    Claymore::TotalHashRate.call(line)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fluent-plugin-claymore-1.0.0 test/claymore/test_total_hash_rate.rb