Sha256: 78ba3e0c116a05129c672abf6ff657782468819694ff7c007593ca1d692782df

Contents?: true

Size: 1012 Bytes

Versions: 31

Compression:

Stored size: 1012 Bytes

Contents

# Not intended to be run as part of a larger suite.

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..') unless $SETUP_LOADED
require 'test/unit'
require 'watir'
require 'watir/process'

class TC_IE_Each < Test::Unit::TestCase  
  def setup
    assert_equal 0, Watir::IE.process_count
    @hits = 0
    @ie = []
  end
  
  def hit_me
    @hits += 1
  end

  def test_zero_windows
    Watir::IE.each {hit_me}    
    assert_equal 0, @hits
  end
  
  def test_one_window
    @ie << Watir::IE.new_process
    Watir::IE.each {hit_me}    
    assert_equal 1, @hits
  end
  
  def test_two_windows
    @ie << Watir::IE.new_process
    @ie << Watir::IE.new_process
    Watir::IE.each {hit_me}    
    assert_equal 2, @hits
  end
  
  def test_return_type
    @ie << Watir::IE.new_process
    Watir::IE.each {|ie| assert_equal(Watir::IE, ie.class)}    
  end
  
  def teardown
    @ie.each {|ie| ie.close }
    Wait.until {Watir::IE.process_count == 0}
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
watir-3.0.0.rc2 unittests/windows/ie-each_test.rb
watir-3.0.0.rc1 unittests/windows/ie-each_test.rb
watir-2.0.4 unittests/windows/ie-each_test.rb
watir-2.0.3 unittests/windows/ie-each_test.rb
watir-2.0.2 unittests/windows/ie-each_test.rb
watir-2.0.2.rc1 unittests/windows/ie-each_test.rb
watir-2.0.1 unittests/windows/ie-each_test.rb
watir-2.0.0 unittests/windows/ie-each_test.rb
watir-2.0.0.rc3 unittests/windows/ie-each_test.rb
watir-2.0.0.rc2 unittests/windows/ie-each_test.rb
watir-1.9.2 unittests/windows/ie-each_test.rb
watir-1.9.2.rc1 unittests/windows/ie-each_test.rb
watir-1.9.1 unittests/windows/ie-each_test.rb
watir-1.9.1.rc1 unittests/windows/ie-each_test.rb
watir-1.9.0 unittests/windows/ie-each_test.rb
watir-1.9.0.rc7 unittests/windows/ie-each_test.rb
watir-1.9.0.rc6 unittests/windows/ie-each_test.rb
watir-1.9.0.rc5 unittests/windows/ie-each_test.rb
watir-1.9.0.rc4 unittests/windows/ie-each_test.rb
watir-1.9.0.rc3 unittests/windows/ie-each_test.rb