toothbrush 0.1.5 → 0.1.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5cab23c424716b62f91cc911e5cc791b7996a59
4
- data.tar.gz: 63dae1dc762876bf9b631d14433b65a51dd47b6f
3
+ metadata.gz: e729053dd3e4656eac581379c6d50103cfbdc77f
4
+ data.tar.gz: 51aa92f76c716fb31296b74c04e3bbde8885ac8c
5
5
  SHA512:
6
- metadata.gz: 47a187e4cad4dcbcad24ba42af9f5ca50847876a8466375399c77339ade89a4e3773d99b499c497dec263c02778e091eab0ea7dbaf4d2e2348dea7b9fa645b23
7
- data.tar.gz: 9dc68841bf341c38a27df44c17e8fea4097472b9c7e22b27345153c15d1c45df501502dd4bba3ff0a13e24486949205070ad0298713bc6160cb024453736c859
6
+ metadata.gz: ebe6b2deabfbe3b24d4c7141ded8b3695f124359f5d2a97d29ad80c24b547802a9a61902d6b371e3f4cd4ed71c0665983346ed0cc61502edbd098c1675165dc8
7
+ data.tar.gz: 7bdb18f32932475d5c00dcdb8777ab0edd569247f887402f398e13ca4ba01a734f9efa86081512e7db4a70419aa26e585c46031fbf041be09e0005f8b8e49976
@@ -125,7 +125,14 @@ RSpec::Matchers.define :include_table do |selector, *header_content|
125
125
  check_foot = lambda do
126
126
  return true unless expected_foot
127
127
  return false if expected_foot && !has_tfoot[]
128
- html_foot[] == expected_foot
128
+ if !column_equivalence.empty?
129
+ columns = column_equivalence.sort_by {|k, v| k }.map {|(k, v)| v }
130
+ foot_values = html_foot[]
131
+ foot_to_compare = columns.map {|index| foot_values[index] }
132
+ else
133
+ foot_to_compare = html_foot[]
134
+ end
135
+ foot_to_compare == expected_foot
129
136
  end
130
137
 
131
138
  result = check_selector[] && check_header[] && check_content[] && check_foot[]
@@ -106,16 +106,48 @@
106
106
  <tr>
107
107
  <td>1</td>
108
108
  <td>2</td>
109
+ <td>3</td>
109
110
  </tr>
110
111
  <tr>
111
- <td>3</td>
112
112
  <td>4</td>
113
+ <td>5</td>
114
+ <td>6</td>
113
115
  </tr>
114
116
  </tbody>
115
117
  <tfoot>
116
118
  <tr>
119
+ <td>7</td>
120
+ <td>8</td>
121
+ <td>9</td>
122
+ </tr>
123
+ </tfoot>
124
+ </table>
125
+
126
+ <table id='with-tfoot-thead'>
127
+ <thead>
128
+ <tr>
129
+ <th>First</th>
130
+ <th>Second</th>
131
+ <th>Third</th>
132
+ </tr>
133
+ </thead>
134
+ <tbody>
135
+ <tr>
136
+ <td>1</td>
137
+ <td>2</td>
138
+ <td>3</td>
139
+ </tr>
140
+ <tr>
141
+ <td>4</td>
117
142
  <td>5</td>
118
143
  <td>6</td>
119
144
  </tr>
145
+ </tbody>
146
+ <tfoot>
147
+ <tr>
148
+ <td>7</td>
149
+ <td>8</td>
150
+ <td>9</td>
151
+ </tr>
120
152
  </tfoot>
121
153
  </table>
@@ -165,6 +165,51 @@ but found
165
165
  %w( 0 Fluminense ),
166
166
  %w( 0 Botafogo )]
167
167
  end
168
+
169
+ describe 'supports <tfoot>' do
170
+ it 'passing' do
171
+ expect {
172
+ expect(page).to include_table '#with-tfoot',
173
+ [%w( 1 2 3 ),
174
+ %w( 4 5 6 )],
175
+ %w( 7 8 9 )
176
+ }.to_not raise_error
177
+ end
178
+
179
+ it 'failing' do
180
+ expect {
181
+ expect(page).to include_table '#with-tfoot',
182
+ [%w( 1 2 3 ),
183
+ %w( 4 5 6 )],
184
+ %w( 7 8 0 )
185
+ }.to raise_error(RSpec::Expectations::ExpectationNotMetError,
186
+ """expected to include table
187
+ +---+---+---+
188
+ | 1 | 2 | 3 |
189
+ | 4 | 5 | 6 |
190
+ +---+---+---+
191
+ | 7 | 8 | 0 |
192
+ +---+---+---+
193
+ but found
194
+ +---+---+---+
195
+ | 1 | 2 | 3 |
196
+ | 4 | 5 | 6 |
197
+ +---+---+---+
198
+ | 7 | 8 | 9 |
199
+ +---+---+---+
200
+ """)
201
+ end
202
+
203
+ it 'supports omitted columns' do
204
+ expect {
205
+ expect(page).to include_table '#with-tfoot-thead',
206
+ %w( First Third ),
207
+ [%w( 1 3 ),
208
+ %w( 4 6 )],
209
+ %w( 7 9 )
210
+ }.to_not raise_error
211
+ end
212
+ end
168
213
  end
169
214
 
170
215
  it 'supports table having nothing inside' do
@@ -186,39 +231,4 @@ but found
186
231
  ++
187
232
  """)
188
233
  end
189
-
190
- describe 'supports <tfoot>' do
191
- it 'passing' do
192
- expect {
193
- expect(page).to include_table '#with-tfoot',
194
- [%w( 1 2 ),
195
- %w( 3 4 )],
196
- %w( 5 6 )
197
- }.to_not raise_error
198
- end
199
-
200
- it 'failing' do
201
- expect {
202
- expect(page).to include_table '#with-tfoot',
203
- [%w( 1 2 ),
204
- %w( 3 4 )],
205
- %w( 5 7 )
206
- }.to raise_error(RSpec::Expectations::ExpectationNotMetError,
207
- """expected to include table
208
- +---+---+
209
- | 1 | 2 |
210
- | 3 | 4 |
211
- +---+---+
212
- | 5 | 7 |
213
- +---+---+
214
- but found
215
- +---+---+
216
- | 1 | 2 |
217
- | 3 | 4 |
218
- +---+---+
219
- | 5 | 6 |
220
- +---+---+
221
- """)
222
- end
223
- end
224
234
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "toothbrush"
8
- s.version = "0.1.5"
8
+ s.version = "0.1.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rodrigo Manh\u{e3}es"]
12
- s.date = "2014-06-24"
12
+ s.date = "2014-06-26"
13
13
  s.description = "Useful stuff for testing with Capybara"
14
14
  s.email = "rmanhaes@gmail.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toothbrush
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Manhães
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-24 00:00:00.000000000 Z
11
+ date: 2014-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: text-table
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.11.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.11.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sinatra
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: capybara
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pry-rails
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: Useful stuff for testing with Capybara
@@ -88,8 +88,8 @@ extra_rdoc_files:
88
88
  - LICENSE.txt
89
89
  - README.rdoc
90
90
  files:
91
- - .document
92
- - .rspec
91
+ - ".document"
92
+ - ".rspec"
93
93
  - Gemfile
94
94
  - LICENSE.txt
95
95
  - README.rdoc
@@ -112,17 +112,17 @@ require_paths:
112
112
  - lib
113
113
  required_ruby_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - '>='
120
+ - - ">="
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
124
  rubyforge_project:
125
- rubygems_version: 2.0.3
125
+ rubygems_version: 2.2.2
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: Useful stuff for testing with Capybara