Sha256: cc951cb7a5bdea82eed1b30df86f46344de822ef6e422996788b8ee4d85558dd

Contents?: true

Size: 1.05 KB

Versions: 15

Compression:

Stored size: 1.05 KB

Contents

require 'helper'
require 'set'
require 'example-apps'

class TestSpqrClicker < Test::Unit::TestCase
  include QmfTestHelpers

  def setup
    @child_pid = nil
  end

  def test_no_param_method
    app_setup QmfClicker

    assert_nothing_raised do
      obj = $console.objects(:class=>"QmfClicker", :agent=>@ag)[0]
      
      obj.click
    end
  end

  def test_statistics_empty
    app_setup QmfClicker

    obj = $console.objects(:class=>"QmfClicker", :agent=>@ag)[0]
    assert_equal "clicks", obj.statistics[0][0].name
    assert_equal 0, obj[:clicks]
  end

  def test_statistics_postquery
    app_setup QmfClicker

    x = 0
    
    9.times do
      obj = $console.objects(:class=>"QmfClicker", :agent=>@ag)[0]
      assert_equal x, obj[:clicks]
      
      obj.click
      x = x.succ
    end
  end

  def test_statistics_postupdate
    app_setup QmfClicker

    x = 0
    obj = $console.objects(:class=>"QmfClicker", :agent=>@ag)[0]
    
    9.times do
      obj.update
      assert_equal x, obj[:clicks]
      
      obj.click
      x = x.succ
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
spqr-0.3.6 test/test_spqr_clicker.rb
spqr-0.3.5 test/test_spqr_clicker.rb
spqr-0.3.3 test/test_spqr_clicker.rb
spqr-0.3.2 test/test_spqr_clicker.rb
spqr-0.3.1 test/test_spqr_clicker.rb
spqr-0.3.0 test/test_spqr_clicker.rb
spqr-0.2.4 test/test_spqr_clicker.rb
spqr-0.2.3 test/test_spqr_clicker.rb
spqr-0.2.2 test/test_spqr_clicker.rb
spqr-0.2.0 test/test_spqr_clicker.rb
spqr-0.1.4 test/test_spqr_clicker.rb
spqr-0.1.3 test/test_spqr_clicker.rb
spqr-0.1.2 test/test_spqr_clicker.rb
spqr-0.1.1 test/test_spqr_clicker.rb
spqr-0.1.0 test/test_spqr_clicker.rb