Sha256: 4434fd5c80e55f9de41cee54a84fc89958c9b9fb437a0cba901fafe1b958db32

Contents?: true

Size: 736 Bytes

Versions: 12

Compression:

Stored size: 736 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/common')
require_relative '../lib/mouse'

describe Mouse do

  it "should move it a couple times" do
    old = Mouse.total_movements
    begin
    Timeout::timeout(2) {
      Mouse::jitter_forever_in_own_thread.join
    }
    rescue Timeout::Error
    end
    Mouse.total_movements.should be > old
  end
  
  it "should not move it if the user does" do
    old = Mouse.total_movements
    begin
    Timeout::timeout(2) {
      Mouse::jitter_forever_in_own_thread
      x = 1
      loop {java.awt.Robot.new.mouse_move(500 + (x+=1),500); sleep 0.1; }
    }
    rescue Timeout::Error
    end
    Mouse.total_movements.should == old + 1
  
  end
  
  

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sensible-cinema-0.17.0 spec/mouse.spec.rb
sensible-cinema-0.16.7 spec/mouse.spec.rb
sensible-cinema-0.16.5 spec/mouse.spec.rb
sensible-cinema-0.16.3 spec/mouse.spec.rb
sensible-cinema-0.16.2 spec/mouse.spec.rb
sensible-cinema-0.16.1 spec/mouse.spec.rb
sensible-cinema-0.15.0 spec/mouse.spec.rb
sensible-cinema-0.14.6 spec/mouse.spec.rb
sensible-cinema-0.14.5 spec/mouse.spec.rb
sensible-cinema-0.14.4 spec/mouse.spec.rb
sensible-cinema-0.14.3 spec/mouse.spec.rb
sensible-cinema-0.14.1 spec/mouse.spec.rb