Sha256: 878cc3c34eb5e8ea21c171558f1f531fc41012743117b12a3b3c01091926f9c5

Contents?: true

Size: 965 Bytes

Versions: 12

Compression:

Stored size: 965 Bytes

Contents

puts File.dirname(__FILE__)
require File.dirname(__FILE__) + '/test_helper.rb' 


class HwidTest <  Minitest::Test

  def setup
    @f=Hwid::Base.new
    
  end
  
  def test_basic
    assert @f!=nil, "should be created"
    puts "PLATFORM #{@f.get_platform}"
  end
  def test_prase
    @f.parse('Serial: 1234')
    assert @f.parse('Serial: 1234')=='1234', "basic parse"
    assert @f.parse('Serial:1234')=='1234', "basic parse no blanks"
    assert @f.parse('Serial:1234 ')=='1234', "basic parse trailing blank"
    assert @f.parse(' ')=='unknown', "bad parse"
  end
  def test_system
    assert @f.systemid!='unknown', "return id"
  end
  def test_class
     assert Hwid.systemid!='unknown', "return id is #{Hwid.systemid}"
     assert Hwid.platform!='unknown', "return id is #{Hwid.platform}"
  end
  def test_run_cmd
     d =@f.run_cmd('date')
     t=Time.now.day
     puts d
     assert d.include?(t.to_s), "date is #{d} day is #{t}"
    
  end
    
end
  
 
 

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hwid-0.3.1 test/test_hwid.rb
hwid-0.3.0 test/test_hwid.rb
hwid-0.2.9 test/test_hwid.rb
hwid-0.2.8 test/test_hwid.rb
hwid-0.2.7 test/test_hwid.rb
hwid-0.2.6 test/test_hwid.rb
hwid-0.2.5 test/test_hwid.rb
hwid-0.2.4 test/test_hwid.rb
hwid-0.2.3 test/test_hwid.rb
hwid-0.2.2 test/test_hwid.rb
hwid-0.2.1 test/test_hwid.rb
hwid-0.2.0 test/test_hwid.rb