Sha256: 56c6a89bab811c7049abec7393933c240eed13c130c9e73d78fe7da3f2eeba70

Contents?: true

Size: 1.09 KB

Versions: 12

Compression:

Stored size: 1.09 KB

Contents

puts File.dirname(__FILE__)
#require File.dirname(__FILE__) + '/test_helper.rb' 
require 'rubygems'
require File.expand_path("../test_helper", __FILE__)
#require File.dirname(__FILE__) + '/test_helper.rb' 
#require  '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.4.5 test/test_hwid.rb
hwid-0.4.4 test/test_hwid.rb
hwid-0.4.3 test/test_hwid.rb
hwid-0.4.2 test/test_hwid.rb
hwid-0.4.1 test/test_hwid.rb
hwid-0.4.0 test/test_hwid.rb
hwid-0.3.7 test/test_hwid.rb
hwid-0.3.6 test/test_hwid.rb
hwid-0.3.5 test/test_hwid.rb
hwid-0.3.4 test/test_hwid.rb
hwid-0.3.3 test/test_hwid.rb
hwid-0.3.2 test/test_hwid.rb