Class: RSpecFormUnit

Inherits:
Object
  • Object
show all
Includes:
YourModule
Defined in:
lib/ext/rspec_rformunit.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/ext/rspec_rformunit.rb', line 4

def setup
  @driver = GUIDriver.new()

  @driver.AutoItSetOption("CaretCoordMode",0);
  @driver.AutoItSetOption("ColorMode",1);
  @driver.AutoItSetOption("MouseCoordMode",0);
  @driver.AutoItSetOption("PixelCoordMode",0);
  @driver.AutoItSetOption("SendKeyDelay", 20)

  #Add it yourself

end

#timeout_check_equal(duration, expected, &block) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/ext/rspec_rformunit.rb', line 17

def timeout_check_equal(duration, expected, &block)
  execute_ok = false
  duration.times do
    sleep(1)
    text = instance_eval(&block)
    execute_ok = true and break if (text == expected)
  end
  execute_ok.should == true
end

#timeout_check_include?(duration, expected, &block) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
30
31
32
33
34
35
# File 'lib/ext/rspec_rformunit.rb', line 27

def timeout_check_include?(duration, expected, &block)
  execute_ok = false
  duration.times do
    sleep(1)
    text = instance_eval(&block)
    execute_ok = true and break if text and text.include?(expected)
  end
  execute_ok.should == true
end