watirspec 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ === Version 0.1.3 / 2010-04-06
2
+
3
+ * fixed a bug where inner table was not shown with Watir::Table#to_a when it was not a direct child, but some other element was in between for example form, span, div etc.
4
+
1
5
  === Version 0.1.2 / 2010-04-05
2
6
 
3
7
  * Added match_array matcher for RSpec for using with Array when regular expressions are needed. It is useful when verifying html tables with #to_a method.
data/coverage.data ADDED
Binary file
@@ -1,3 +1,3 @@
1
1
  module WatiRspec
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -105,7 +105,7 @@ module Watir
105
105
  inner_tables = cell.getElementsByTagName("TABLE")
106
106
  inner_tables.each do |inner_table|
107
107
  # make sure that the inner table is directly child for this cell
108
- if inner_table.parentElement.uniqueID == cell.uniqueID
108
+ if inner_table?(cell, inner_table)
109
109
  y << Table.new(@container, :ole_object, inner_table).to_a
110
110
  end
111
111
  end
@@ -116,5 +116,19 @@ module Watir
116
116
  end
117
117
  y
118
118
  end
119
+
120
+ private
121
+ # returns true if inner_table is direct child
122
+ # table for cell and there's not any table-s in between
123
+ def inner_table?(cell, inner_table)
124
+ parent_element = inner_table.parentElement
125
+ if parent_element.uniqueID == cell.uniqueID
126
+ return true
127
+ elsif parent_element.tagName == "TABLE"
128
+ return false
129
+ else
130
+ return inner_table?(cell, parent_element)
131
+ end
132
+ end
119
133
  end
120
134
  end
@@ -14,7 +14,7 @@ describe Watir::Table do
14
14
  %w[4 5 6],
15
15
  %w[7 8 9]
16
16
  ]
17
- table(:id => "normal").to_a.should =~ expected_table
17
+ table(:id => "normal").to_a.should match_array(expected_table)
18
18
  end
19
19
 
20
20
  it "#to_a works with table with headers" do
@@ -23,7 +23,7 @@ describe Watir::Table do
23
23
  %w[5 6 7 8],
24
24
  %w[9 10 11 12],
25
25
  ]
26
- table(:id => "headers").to_a.should =~ expected_table
26
+ table(:id => "headers").to_a.should match_array(expected_table)
27
27
  end
28
28
 
29
29
  it "#to_a works with nested tables" do
@@ -31,7 +31,16 @@ describe Watir::Table do
31
31
  %w[1 2],
32
32
  [[%w[11 12], %w[13 14]], "3"]
33
33
  ]
34
- table(:id => "nested").to_a.should =~ expected_table
34
+ table(:id => "nested").to_a.should match_array(expected_table)
35
+ end
36
+
37
+ it "#to_a works with nested table with non-direct child" do
38
+ expected_table = [
39
+ %w[1 2],
40
+ [[%w[11 12], %w[13 14]], "3"]
41
+ ]
42
+
43
+ table(:id => "nestednondirectchild").to_a.should match_array(expected_table)
35
44
  end
36
45
 
37
46
  it "#to_a works with deep-nested tables" do
@@ -39,7 +48,7 @@ describe Watir::Table do
39
48
  %w[1 2],
40
49
  [[%w[11 12], [[["404", "405"], ["406", "407"]], "14"]], "3"]
41
50
  ]
42
- table(:id => "deepnested").to_a.should =~ expected_table
51
+ table(:id => "deepnested").to_a.should match_array(expected_table)
43
52
  end
44
53
 
45
54
  it "#to_a works with colspan" do
@@ -47,7 +56,7 @@ describe Watir::Table do
47
56
  %w[1 2],
48
57
  ["3"]
49
58
  ]
50
- table(:id => "colspan").to_a.should =~ expected_table
59
+ table(:id => "colspan").to_a.should match_array(expected_table)
51
60
  end
52
61
 
53
62
  it "#to_a works with rowspan" do
@@ -56,6 +65,6 @@ describe Watir::Table do
56
65
  %w[3 4],
57
66
  %w[5]
58
67
  ]
59
- table(:id => "rowspan").to_a.should =~ expected_table
68
+ table(:id => "rowspan").to_a.should match_array(expected_table)
60
69
  end
61
70
  end
data/todo.txt ADDED
@@ -0,0 +1 @@
1
+ viga, et kui n�iteks inner table ei ole otsene element tabeli all, vaid n�iteks on veel vahepeal ka span v�i form vms, siis seda tabelit ei leita...
Binary file
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jarmo Pertman
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-05 00:00:00 +03:00
17
+ date: 2010-04-06 00:00:00 +03:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -118,6 +118,7 @@ extra_rdoc_files:
118
118
  - License.txt
119
119
  files:
120
120
  - bin/watirspec
121
+ - coverage.data
121
122
  - History.rdoc
122
123
  - lib/spec.opts
123
124
  - lib/watirspec/autoit.rb
@@ -146,6 +147,7 @@ files:
146
147
  - templates/project/environment.rb
147
148
  - templates/project/ide_runner.rb
148
149
  - templates/project/spec/dummy_spec.rb
150
+ - todo.txt
149
151
  - watirspec-0.1.1.gem
150
152
  - watirspec-0.1.2.gem
151
153
  has_rdoc: true
@@ -189,6 +191,6 @@ rubyforge_project:
189
191
  rubygems_version: 1.3.6
190
192
  signing_key:
191
193
  specification_version: 3
192
- summary: watirspec 0.1.2
194
+ summary: watirspec 0.1.3
193
195
  test_files: []
194
196