elabs_matchers 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/Gemfile.lock +37 -26
- data/README.md +57 -47
- data/development.txt +26 -0
- data/doc/ElabsMatchers/Helpers/Fixtures.html +33 -23
- data/doc/ElabsMatchers/Helpers/NormalizeKeys.html +222 -0
- data/doc/ElabsMatchers/Helpers/ReloadRecord.html +302 -0
- data/doc/ElabsMatchers/Helpers/SelectYearAndMonth.html +251 -0
- data/doc/ElabsMatchers/Helpers.html +29 -22
- data/doc/ElabsMatchers/Matchers/Allow/AllowMatcher.html +707 -0
- data/doc/ElabsMatchers/Matchers/Allow.html +229 -0
- data/doc/ElabsMatchers/Matchers/ContainHash/ContainHashMatcher.html +506 -0
- data/doc/ElabsMatchers/Matchers/ContainHash.html +222 -0
- data/doc/ElabsMatchers/Matchers/HaveAttribute/HaveAttributeMatcher.html +656 -0
- data/doc/ElabsMatchers/Matchers/HaveAttribute.html +239 -0
- data/doc/ElabsMatchers/Matchers/HaveFields/HaveFieldsMatcher.html +572 -0
- data/doc/ElabsMatchers/Matchers/HaveFields.html +220 -0
- data/doc/ElabsMatchers/Matchers/HaveFlash/HaveFlashMatcher.html +654 -0
- data/doc/ElabsMatchers/Matchers/HaveFlash.html +306 -0
- data/doc/ElabsMatchers/Matchers/HaveFormErrorsOn/HaveFormErrorsOnMatcher.html +678 -0
- data/doc/ElabsMatchers/Matchers/HaveFormErrorsOn.html +236 -0
- data/doc/ElabsMatchers/Matchers/HaveHeader/HaveHeaderMatcher.html +568 -0
- data/doc/ElabsMatchers/Matchers/HaveHeader.html +219 -0
- data/doc/ElabsMatchers/Matchers/HaveImage/HaveImageMatcher.html +592 -0
- data/doc/ElabsMatchers/Matchers/HaveImage.html +219 -0
- data/doc/ElabsMatchers/Matchers/HaveTableRow/HaveTableRowMatcher.html +654 -0
- data/doc/ElabsMatchers/Matchers/HaveTableRow.html +236 -0
- data/doc/ElabsMatchers/Matchers/OnlyInclude/OnlyIncludeMatcher.html +494 -0
- data/doc/ElabsMatchers/Matchers/OnlyInclude.html +221 -0
- data/doc/ElabsMatchers/Matchers/Persist/PersistMatcher.html +586 -0
- data/doc/ElabsMatchers/Matchers/Persist.html +235 -0
- data/doc/ElabsMatchers/Matchers.html +29 -22
- data/doc/ElabsMatchers.html +1144 -21
- data/doc/_index.html +161 -79
- data/doc/class_list.html +12 -6
- data/doc/css/full_list.css +4 -2
- data/doc/css/style.css +50 -44
- data/doc/file.README.html +71 -73
- data/doc/file_list.html +12 -6
- data/doc/frames.html +20 -5
- data/doc/index.html +71 -73
- data/doc/js/app.js +52 -43
- data/doc/js/full_list.js +9 -9
- data/doc/js/jquery.js +4 -16
- data/doc/method_list.html +603 -77
- data/doc/top-level-namespace.html +24 -103
- data/elabs_matchers.gemspec +4 -3
- data/history.txt +15 -0
- data/lib/elabs_matchers/extensions/module.rb +24 -0
- data/lib/elabs_matchers/helpers/fixtures.rb +2 -2
- data/lib/elabs_matchers/helpers/{common.rb → normalize_keys.rb} +3 -4
- data/lib/elabs_matchers/helpers/{orm.rb → reload_record.rb} +9 -6
- data/lib/elabs_matchers/helpers/{capybara.rb → select_year_and_month.rb} +5 -3
- data/lib/elabs_matchers/matchers/allow.rb +130 -0
- data/lib/elabs_matchers/matchers/contain_hash.rb +58 -0
- data/lib/elabs_matchers/matchers/have_attribute.rb +62 -0
- data/lib/elabs_matchers/matchers/have_fields.rb +45 -0
- data/lib/elabs_matchers/matchers/have_flash.rb +65 -0
- data/lib/elabs_matchers/matchers/have_form_errors_on.rb +79 -0
- data/lib/elabs_matchers/matchers/have_header.rb +53 -0
- data/lib/elabs_matchers/matchers/have_image.rb +69 -0
- data/lib/elabs_matchers/matchers/have_table_row.rb +113 -0
- data/lib/elabs_matchers/matchers/only_include.rb +41 -0
- data/lib/elabs_matchers/matchers/persist.rb +42 -0
- data/lib/elabs_matchers/version.rb +1 -1
- data/lib/elabs_matchers.rb +90 -10
- data/spec/elabs_matchers/helpers/fixtures_spec.rb +1 -1
- data/spec/elabs_matchers/helpers/{common_spec.rb → normalize_keys_spec.rb} +2 -2
- data/spec/elabs_matchers/helpers/{orm_spec.rb → reload_record_spec.rb} +3 -2
- data/spec/elabs_matchers/helpers/select_year_and_month_spec.rb +32 -0
- data/spec/elabs_matchers/matchers/{rspec/allow_spec.rb → allow_spec.rb} +5 -4
- data/spec/elabs_matchers/matchers/contain_hash_spec.rb +86 -0
- data/spec/elabs_matchers/matchers/have_attribute_spec.rb +65 -0
- data/spec/elabs_matchers/matchers/have_fields_spec.rb +46 -0
- data/spec/elabs_matchers/matchers/have_flash_spec.rb +97 -0
- data/spec/elabs_matchers/matchers/have_form_errors_on_spec.rb +93 -0
- data/spec/elabs_matchers/matchers/have_header_spec.rb +54 -0
- data/spec/elabs_matchers/matchers/have_image_spec.rb +49 -0
- data/spec/elabs_matchers/matchers/have_table_row_spec.rb +119 -0
- data/spec/elabs_matchers/matchers/only_include_spec.rb +32 -0
- data/spec/elabs_matchers/matchers/persist_spec.rb +21 -0
- data/{lib/elabs_matchers/orm → spec/fixtures}/post.rb +0 -0
- data/spec/spec_helper.rb +19 -8
- data/todo.txt +6 -0
- metadata +104 -48
- data/lib/elabs_matchers/cucumber/common.rb +0 -57
- data/lib/elabs_matchers/helpers/session.rb +0 -81
- data/lib/elabs_matchers/matchers/capybara/common.rb +0 -245
- data/lib/elabs_matchers/matchers/rspec/allow.rb +0 -112
- data/lib/elabs_matchers/matchers/rspec/common.rb +0 -59
- data/lib/elabs_matchers/matchers/rspec/orm.rb +0 -29
- data/spec/elabs_matchers/cucumber/common_spec.rb +0 -49
- data/spec/elabs_matchers/helpers/capybara_spec.rb +0 -32
- data/spec/elabs_matchers/helpers/session_spec.rb +0 -35
- data/spec/elabs_matchers/matchers/capybara/common_spec.rb +0 -202
- data/spec/elabs_matchers/matchers/rspec/common_spec.rb +0 -74
- data/spec/elabs_matchers/matchers/rspec/orm_spec.rb +0 -16
data/doc/css/full_list.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
body {
|
1
|
+
body {
|
2
2
|
margin: 0;
|
3
|
-
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
3
|
+
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
4
4
|
font-size: 13px;
|
5
5
|
height: 101%;
|
6
6
|
overflow-x: hidden;
|
@@ -37,6 +37,8 @@ li.collapsed.clicked a.toggle { background-position: top right; }
|
|
37
37
|
#nav { margin-left: 10px; font-size: 0.9em; display: none; color: #aaa; }
|
38
38
|
#nav a:link, #nav a:visited { color: #358; }
|
39
39
|
#nav a:hover { background: transparent; color: #5af; }
|
40
|
+
.frames #nav span:after { content: ' | '; }
|
41
|
+
.frames #nav span:last-child:after { content: ''; }
|
40
42
|
|
41
43
|
.frames #content h1 { margin-top: 0; }
|
42
44
|
.frames li { white-space: nowrap; cursor: normal; }
|
data/doc/css/style.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
body {
|
1
|
+
body {
|
2
2
|
padding: 0 20px;
|
3
|
-
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
3
|
+
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
4
4
|
font-size: 13px;
|
5
5
|
}
|
6
6
|
body.frames { padding: 0 5px; }
|
@@ -8,7 +8,7 @@ h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dot
|
|
8
8
|
h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; }
|
9
9
|
h1.title { margin-bottom: 10px; }
|
10
10
|
h1.alphaindex { margin-top: 0; font-size: 22px; }
|
11
|
-
h2 {
|
11
|
+
h2 {
|
12
12
|
padding: 0;
|
13
13
|
padding-bottom: 3px;
|
14
14
|
border-bottom: 1px #aaa solid;
|
@@ -36,9 +36,9 @@ h2 small { font-weight: normal; font-size: 0.7em; display: block; float: right;
|
|
36
36
|
#filecontents dd, .docstring dd { padding: 5px 0px; margin-left: 18px; }
|
37
37
|
#filecontents dd > p, .docstring dd > p { margin: 0px; }
|
38
38
|
|
39
|
-
.note {
|
39
|
+
.note {
|
40
40
|
color: #222;
|
41
|
-
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
41
|
+
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
42
42
|
background: #e3e4e3; border: 1px solid #d5d5d5; padding: 7px 10px;
|
43
43
|
display: block;
|
44
44
|
}
|
@@ -46,13 +46,14 @@ h2 small { font-weight: normal; font-size: 0.7em; display: block; float: right;
|
|
46
46
|
.note.returns_void { background: #efefef; }
|
47
47
|
.note.deprecated { background: #ffe5e5; border-color: #e9dada; }
|
48
48
|
.note.private { background: #ffffc5; border-color: #ececaa; }
|
49
|
-
.note.title {
|
49
|
+
.note.title { padding: 1px 5px; font-size: 0.9em; font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; display: inline; }
|
50
50
|
.summary_signature + .note.title { margin-left: 7px; }
|
51
51
|
h1 .note.title { font-size: 0.5em; font-weight: normal; padding: 3px 5px; position: relative; top: -3px; text-transform: capitalize; }
|
52
|
-
.note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
53
|
-
.note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; }
|
54
|
-
.note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
52
|
+
.note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
53
|
+
.note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; }
|
54
|
+
.note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; }
|
55
55
|
.note.title.private { background: #d5d5d5; border-color: #c5c5c5; }
|
56
|
+
.note.title.not_defined_here { background: transparent; border: none; font-style: italic; }
|
56
57
|
.discussion .note { margin-top: 6px; }
|
57
58
|
.discussion .note:first-child { margin-top: 0; }
|
58
59
|
|
@@ -106,10 +107,8 @@ p.inherited {
|
|
106
107
|
#filecontents dl.box .r1, dl.box .r1 { background: #eee; }
|
107
108
|
|
108
109
|
ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; }
|
109
|
-
|
110
|
-
|
111
|
-
#files { padding: 0; }
|
112
|
-
#files li { list-style: none; display: inline; padding: 7px 12px; line-height: 35px; }
|
110
|
+
.index_inline_list { padding-left: 0; font-size: 1.1em; }
|
111
|
+
.index_inline_list li { list-style: none; display: inline; padding: 7px 12px; line-height: 35px; }
|
113
112
|
|
114
113
|
dl.constants { margin-left: 40px; }
|
115
114
|
dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; }
|
@@ -125,29 +124,36 @@ dl.constants .discussion *:last-child { margin-bottom: 0; }
|
|
125
124
|
|
126
125
|
.method_details { border-top: 1px dotted #aaa; margin-top: 15px; padding-top: 0; }
|
127
126
|
.method_details.first { border: 0; }
|
128
|
-
p.signature {
|
129
|
-
font-size: 1.1em; font-weight: normal; font-family: Monaco, Consolas, Courier, monospace;
|
130
|
-
padding: 6px 10px; margin-top: 18px;
|
127
|
+
p.signature, h3.signature {
|
128
|
+
font-size: 1.1em; font-weight: normal; font-family: Monaco, Consolas, Courier, monospace;
|
129
|
+
padding: 6px 10px; margin-top: 18px;
|
131
130
|
background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px;
|
132
131
|
}
|
133
|
-
p.signature tt
|
134
|
-
|
135
|
-
p.signature .
|
136
|
-
|
137
|
-
p.signature .
|
132
|
+
p.signature tt,
|
133
|
+
h3.signature tt { font-family: Monaco, Consolas, Courier, monospace; }
|
134
|
+
p.signature .overload,
|
135
|
+
h3.signature .overload { display: block; }
|
136
|
+
p.signature .extras,
|
137
|
+
h3.signature .extras { font-weight: normal; font-family: sans-serif; color: #444; font-size: 1em; }
|
138
|
+
p.signature .not_defined_here,
|
139
|
+
h3.signature .not_defined_here,
|
140
|
+
p.signature .aliases,
|
141
|
+
h3.signature .aliases { display: block; font-weight: normal; font-size: 0.9em; font-family: sans-serif; margin-top: 0px; color: #555; }
|
142
|
+
p.signature .aliases .names,
|
143
|
+
h3.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace; font-weight: bold; color: #000; font-size: 1.2em; }
|
138
144
|
|
139
|
-
.tags
|
145
|
+
.tags .tag_title { font-size: 1em; margin-bottom: 0; font-weight: bold; }
|
140
146
|
.tags ul { margin-top: 5px; padding-left: 30px; list-style: square; }
|
141
147
|
.tags ul li { margin-bottom: 3px; }
|
142
148
|
.tags ul .name { font-family: monospace; font-weight: bold; }
|
143
149
|
.tags ul .note { padding: 3px 6px; }
|
144
150
|
.tags { margin-bottom: 12px; }
|
145
151
|
|
146
|
-
.tags .examples
|
147
|
-
.tags .examples
|
152
|
+
.tags .examples .tag_title { margin-bottom: 10px; font-weight: bold; }
|
153
|
+
.tags .examples .inline p { padding: 0; margin: 0; margin-left: 15px; font-weight: bold; font-size: 0.9em; }
|
148
154
|
|
149
155
|
.tags .overload .overload_item { list-style: none; margin-bottom: 25px; }
|
150
|
-
.tags .overload .overload_item .signature {
|
156
|
+
.tags .overload .overload_item .signature {
|
151
157
|
padding: 2px 8px;
|
152
158
|
background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px;
|
153
159
|
}
|
@@ -171,19 +177,19 @@ ul.summary {
|
|
171
177
|
font-size: 1em;
|
172
178
|
line-height: 1.5em;
|
173
179
|
}
|
174
|
-
ul.summary a:link, ul.summary a:visited {
|
180
|
+
ul.summary a:link, ul.summary a:visited {
|
175
181
|
text-decoration: none; font-size: 1.1em;
|
176
182
|
}
|
177
183
|
ul.summary li { margin-bottom: 5px; }
|
178
|
-
.summary .summary_signature {
|
184
|
+
.summary .summary_signature {
|
179
185
|
padding: 1px 10px;
|
180
186
|
background: #eaeaff; border: 1px solid #dfdfe5;
|
181
|
-
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
187
|
+
-moz-border-radius: 3px; -webkit-border-radius: 3px;
|
182
188
|
}
|
183
189
|
.summary_signature:hover { background: #eeeeff; cursor: pointer; }
|
184
190
|
ul.summary.compact li { display: inline-block; margin: 0px 5px 0px 0px; line-height: 2.6em;}
|
185
191
|
ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; }
|
186
|
-
#content .summary_signature:hover a:link,
|
192
|
+
#content .summary_signature:hover a:link,
|
187
193
|
#content .summary_signature:hover a:visited {
|
188
194
|
background: transparent;
|
189
195
|
color: #48f;
|
@@ -206,18 +212,18 @@ ul.fullTree li:last-child { padding-bottom: 0; }
|
|
206
212
|
.showAll .inheritName { display: none; }
|
207
213
|
|
208
214
|
#search { position: absolute; right: 14px; top: 0px; }
|
209
|
-
#search a:link, #search a:visited {
|
215
|
+
#search a:link, #search a:visited {
|
210
216
|
display: block; float: left; margin-right: 4px;
|
211
217
|
padding: 8px 10px; text-decoration: none; color: #05a;
|
212
218
|
border: 1px solid #d8d8e5;
|
213
|
-
-moz-border-radius-bottomleft: 3px; -moz-border-radius-bottomright: 3px;
|
219
|
+
-moz-border-radius-bottomleft: 3px; -moz-border-radius-bottomright: 3px;
|
214
220
|
-webkit-border-bottom-left-radius: 3px; -webkit-border-bottom-right-radius: 3px;
|
215
221
|
background: #eaf0ff;
|
216
222
|
-webkit-box-shadow: -1px 1px 3px #ddd;
|
217
223
|
}
|
218
224
|
#search a:hover { background: #f5faff; color: #06b; }
|
219
|
-
#search a.active {
|
220
|
-
background: #568; padding-bottom: 20px; color: #fff; border: 1px solid #457;
|
225
|
+
#search a.active {
|
226
|
+
background: #568; padding-bottom: 20px; color: #fff; border: 1px solid #457;
|
221
227
|
-moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px;
|
222
228
|
-webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px;
|
223
229
|
}
|
@@ -231,7 +237,7 @@ ul.fullTree li:last-child { padding-bottom: 0; }
|
|
231
237
|
#menu .title { color: #555; }
|
232
238
|
#menu a:link, #menu a:visited { color: #333; text-decoration: none; border-bottom: 1px dotted #bbd; }
|
233
239
|
#menu a:hover { color: #05a; }
|
234
|
-
#menu .noframes { display:
|
240
|
+
#menu .noframes { display: inline; }
|
235
241
|
.frames #menu .noframes { display: inline; float: right; }
|
236
242
|
|
237
243
|
#footer { margin-top: 15px; border-top: 1px solid #ccc; text-align: center; padding: 7px 0; color: #999; }
|
@@ -251,8 +257,8 @@ li.r2 { background: #fafafa; }
|
|
251
257
|
z-index: 9999;
|
252
258
|
background: #fff;
|
253
259
|
display: none;
|
254
|
-
position: absolute;
|
255
|
-
top: 36px;
|
260
|
+
position: absolute;
|
261
|
+
top: 36px;
|
256
262
|
right: 18px;
|
257
263
|
width: 500px;
|
258
264
|
height: 80%;
|
@@ -268,7 +274,7 @@ li.r2 { background: #fafafa; }
|
|
268
274
|
#content ul.summary li.deprecated .summary_signature a:link,
|
269
275
|
#content ul.summary li.deprecated .summary_signature a:visited { text-decoration: line-through; font-style: italic; }
|
270
276
|
|
271
|
-
#toc {
|
277
|
+
#toc {
|
272
278
|
padding: 20px; padding-right: 30px; border: 1px solid #ddd; float: right; background: #fff; margin-left: 20px; margin-bottom: 20px;
|
273
279
|
max-width: 300px;
|
274
280
|
-webkit-box-shadow: -2px 2px 6px #bbb;
|
@@ -293,7 +299,7 @@ li.r2 { background: #fafafa; }
|
|
293
299
|
#filecontents pre.code, .docstring pre.code, .source_code pre { font-family: monospace; }
|
294
300
|
#filecontents pre.code, .docstring pre.code { display: block; }
|
295
301
|
.source_code .lines { padding-right: 12px; color: #555; text-align: right; }
|
296
|
-
#filecontents pre.code, .docstring pre.code,
|
302
|
+
#filecontents pre.code, .docstring pre.code,
|
297
303
|
.tags pre.example { padding: 5px 12px; margin-top: 4px; border: 1px solid #eef; background: #f5f5ff; }
|
298
304
|
pre.code { color: #000; }
|
299
305
|
pre.code .info.file { color: #555; }
|
@@ -302,21 +308,21 @@ pre.code .tstring_content,
|
|
302
308
|
pre.code .heredoc_beg, pre.code .heredoc_end,
|
303
309
|
pre.code .qwords_beg, pre.code .qwords_end,
|
304
310
|
pre.code .tstring, pre.code .dstring { color: #036A07; }
|
305
|
-
pre.code .fid, pre.code .rubyid_new, pre.code .rubyid_to_s,
|
306
|
-
pre.code .rubyid_to_sym, pre.code .rubyid_to_f,
|
311
|
+
pre.code .fid, pre.code .rubyid_new, pre.code .rubyid_to_s,
|
312
|
+
pre.code .rubyid_to_sym, pre.code .rubyid_to_f,
|
307
313
|
pre.code .dot + pre.code .id,
|
308
314
|
pre.code .rubyid_to_i pre.code .rubyid_each { color: #0085FF; }
|
309
315
|
pre.code .comment { color: #0066FF; }
|
310
316
|
pre.code .const, pre.code .constant { color: #585CF6; }
|
311
317
|
pre.code .symbol { color: #C5060B; }
|
312
|
-
pre.code .kw,
|
318
|
+
pre.code .kw,
|
313
319
|
pre.code .label,
|
314
|
-
pre.code .rubyid_require,
|
320
|
+
pre.code .rubyid_require,
|
315
321
|
pre.code .rubyid_extend,
|
316
322
|
pre.code .rubyid_include { color: #0000FF; }
|
317
323
|
pre.code .ivar { color: #318495; }
|
318
|
-
pre.code .gvar,
|
319
|
-
pre.code .rubyid_backref,
|
324
|
+
pre.code .gvar,
|
325
|
+
pre.code .rubyid_backref,
|
320
326
|
pre.code .rubyid_nth_ref { color: #6D79DE; }
|
321
327
|
pre.code .regexp, .dregexp { color: #036A07; }
|
322
328
|
pre.code a { border-bottom: 1px dotted #bbf; }
|
data/doc/file.README.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.
|
9
|
+
— Documentation by YARD 0.8.2.1
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -15,10 +15,12 @@
|
|
15
15
|
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
16
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
18
19
|
relpath = '';
|
19
|
-
|
20
|
+
framesUrl = "frames.html#!" + escape(window.location.href);
|
20
21
|
</script>
|
21
22
|
|
23
|
+
|
22
24
|
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
23
25
|
|
24
26
|
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
@@ -26,34 +28,39 @@
|
|
26
28
|
|
27
29
|
</head>
|
28
30
|
<body>
|
29
|
-
<script type="text/javascript" charset="utf-8">
|
30
|
-
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
-
</script>
|
32
|
-
|
33
31
|
<div id="header">
|
34
32
|
<div id="menu">
|
35
33
|
|
36
|
-
<a href="_index.html"
|
34
|
+
<a href="_index.html">Index</a> »
|
37
35
|
<span class="title">File: README</span>
|
38
36
|
|
39
|
-
|
37
|
+
|
40
38
|
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
39
|
</div>
|
42
40
|
|
43
41
|
<div id="search">
|
44
42
|
|
45
|
-
<a
|
43
|
+
<a class="full_list_link" id="class_list_link"
|
44
|
+
href="class_list.html">
|
45
|
+
Class List
|
46
|
+
</a>
|
46
47
|
|
47
|
-
<a
|
48
|
+
<a class="full_list_link" id="method_list_link"
|
49
|
+
href="method_list.html">
|
50
|
+
Method List
|
51
|
+
</a>
|
48
52
|
|
49
|
-
<a
|
53
|
+
<a class="full_list_link" id="file_list_link"
|
54
|
+
href="file_list.html">
|
55
|
+
File List
|
56
|
+
</a>
|
50
57
|
|
51
58
|
</div>
|
52
59
|
<div class="clear"></div>
|
53
60
|
</div>
|
54
|
-
|
61
|
+
|
55
62
|
<iframe id="search_frame"></iframe>
|
56
|
-
|
63
|
+
|
57
64
|
<div id="content"><div id='filecontents'><h1>Elabs matchers</h1>
|
58
65
|
|
59
66
|
<p><a href="http://travis-ci.org/elabs/elabs_matchers"><img src="https://secure.travis-ci.org/elabs/elabs_matchers.png" alt="Build Status"></a></p>
|
@@ -62,90 +69,81 @@
|
|
62
69
|
of less generic once. This could be things like asserting a table appearing in a certain way or check that
|
63
70
|
an active record instance has been successfully persisted after an update.</p>
|
64
71
|
|
72
|
+
<p>It is important to know that this gem aims to extend rspec / capybara with more matchers. If functionality in either of theses
|
73
|
+
makes any of elabs matchers' matchers obsolete they will be deprecated and removed from elabs matchers.</p>
|
74
|
+
|
65
75
|
<p>Below follows a list of matchers that the gem bundles. To get documentation about each matcher the source code is
|
66
76
|
your bast friend at this point.</p>
|
67
77
|
|
78
|
+
<h2>Setup</h2>
|
79
|
+
|
80
|
+
<p>add elabs_matchers to your Gemfile:</p>
|
81
|
+
|
82
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>elabs_matchers</span><span class='tstring_end'>"</span></span>
|
83
|
+
</code></pre>
|
84
|
+
|
68
85
|
<h3>Model matchers:</h3>
|
69
86
|
|
70
|
-
<
|
71
|
-
<
|
72
|
-
<
|
73
|
-
<
|
74
|
-
|
75
|
-
</ul>
|
87
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_record'>record</span><span class='period'>.</span><span class='id identifier rubyid_should'>should</span> <span class='id identifier rubyid_allow'>allow</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Blog post</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_as'>as</span><span class='lparen'>(</span><span class='symbol'>:title</span><span class='rparen'>)</span>
|
88
|
+
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_contain_hash'>contain_hash</span><span class='lparen'>(</span><span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>baz</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>bar</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='rparen'>)</span>
|
89
|
+
<span class='id identifier rubyid_array'>array</span><span class='period'>.</span><span class='id identifier rubyid_only_include'>only_include</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>bar</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>foo</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
90
|
+
<span class='id identifier rubyid_record'>record</span><span class='period'>.</span><span class='id identifier rubyid_should'>should</span> <span class='id identifier rubyid_persist'>persist</span><span class='lparen'>(</span><span class='symbol'>:title</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Blog post</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
91
|
+
</code></pre>
|
76
92
|
|
77
93
|
<h3>Model helpers:</h3>
|
78
94
|
|
79
|
-
<
|
80
|
-
<
|
81
|
-
|
82
|
-
</ul>
|
95
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_reload'>reload</span><span class='lparen'>(</span><span class='id identifier rubyid_post'>post</span><span class='rparen'>)</span>
|
96
|
+
<span class='id identifier rubyid_save_and_reload'>save_and_reload</span><span class='lparen'>(</span><span class='id identifier rubyid_post'>post</span><span class='rparen'>)</span>
|
97
|
+
</code></pre>
|
83
98
|
|
84
99
|
<h3>Acceptance matchers:</h3>
|
85
100
|
|
86
|
-
<
|
87
|
-
<
|
88
|
-
<
|
89
|
-
<
|
90
|
-
<
|
91
|
-
<
|
92
|
-
<
|
93
|
-
<
|
94
|
-
|
95
|
-
<li>page.should have_fields("Author" => "Adam", "Year" => "2011")</li>
|
96
|
-
</ul>
|
101
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_should'>should</span> <span class='id identifier rubyid_have_flash_notice'>have_flash_notice</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Success</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
102
|
+
<span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_should'>should</span> <span class='id identifier rubyid_have_flash_alert'>have_flash_alert</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Error</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
103
|
+
<span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_should'>should</span> <span class='id identifier rubyid_have_form_errors_on'>have_form_errors_on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Name</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Can't be blank</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
104
|
+
<span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_should'>should</span> <span class='id identifier rubyid_have_header'>have_header</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Elabs</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
105
|
+
<span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_should'>should</span> <span class='id identifier rubyid_have_image'>have_image</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Logo</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
106
|
+
<span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_should'>should</span> <span class='id identifier rubyid_have_fields'>have_fields</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Author</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Adam</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Year</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>2011</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
107
|
+
<span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_should'>should</span> <span class='id identifier rubyid_have_table_row'>have_table_row</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Posts</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Title</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>First</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:year</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>2012</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
108
|
+
<span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_should'>should</span> <span class='id identifier rubyid_have_attribute'>have_attribute</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Status</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Pending</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
109
|
+
</code></pre>
|
97
110
|
|
98
111
|
<h3>Acceptance helpers:</h3>
|
99
112
|
|
100
|
-
<
|
101
|
-
|
102
|
-
<li>sign_in_as(user)</li>
|
103
|
-
<li>sign_out</li>
|
104
|
-
</ul>
|
113
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_select_year_and_month'>select_year_and_month</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>2010</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>March</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:from</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Birth date</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
114
|
+
</code></pre>
|
105
115
|
|
106
116
|
<h3>Common helpers:</h3>
|
107
117
|
|
108
|
-
<
|
109
|
-
<
|
110
|
-
|
111
|
-
<li>fixture_file("file.txt")</li>
|
112
|
-
</ul>
|
118
|
+
<pre class="code ruby"><code><span class='id identifier rubyid_normalize_keys'>normalize_keys</span><span class='lparen'>(</span><span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>First name</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Adam</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='rparen'>)</span>
|
119
|
+
<span class='id identifier rubyid_fixture_file'>fixture_file</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>file.txt</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
120
|
+
</code></pre>
|
113
121
|
|
114
|
-
<h2>
|
122
|
+
<h2>Configuration</h2>
|
115
123
|
|
116
|
-
<p>
|
124
|
+
<p>Matchers can be configured in e.g your spec_helper.rb-file:</p>
|
117
125
|
|
118
|
-
<pre class="code ruby"><code><span class='
|
126
|
+
<pre class="code ruby"><code><span class='const'>ElabsMatchers</span><span class='period'>.</span><span class='id identifier rubyid_configure'>configure</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span>
|
127
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_header_selector'>header_selector</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>//h1</span><span class='tstring_end'>"</span></span>
|
128
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_header_selector_type'>header_selector_type</span> <span class='op'>=</span> <span class='symbol'>:xpath</span>
|
129
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_image_selector'>image_selector</span> <span class='op'>=</span> <span class='id identifier rubyid_lambda'>lambda</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_src'>src</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>img[src='</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_src'>src</span><span class='rbrace'>}</span><span class='tstring_content'>']</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
130
|
+
<span class='kw'>end</span>
|
119
131
|
</code></pre>
|
120
132
|
|
121
|
-
<p>
|
133
|
+
<p>See <a href="https://github.com/elabs/elabs_matchers/blob/master/lib/elabs_matchers.rb">elabs_matchers.rb</a></p>
|
122
134
|
|
123
|
-
<
|
124
|
-
</code></pre>
|
125
|
-
|
126
|
-
<p>then you'll require them inside your spork prefork block:</p>
|
135
|
+
<h2>More</h2>
|
127
136
|
|
128
|
-
<
|
129
|
-
|
130
|
-
require 'elabs_matchers'
|
131
|
-
...
|
132
|
-
end
|
133
|
-
</code></pre>
|
137
|
+
<p>The gem includes YARD documentation which can be read with any browser.
|
138
|
+
The gem's test suite should also serve as detailed documentation for each matcher and helper.</p>
|
134
139
|
|
135
140
|
<h2>Development</h2>
|
136
141
|
|
137
|
-
<
|
138
|
-
</code></pre>
|
139
|
-
|
140
|
-
<p>should run all the gem's specs.</p>
|
142
|
+
<p>See <a href="https://github.com/elabs/elabs_matchers/blob/master/development.rb">devlopment.txt</a></p>
|
141
143
|
|
142
|
-
<h2>
|
144
|
+
<h2>Contributors</h2>
|
143
145
|
|
144
|
-
<
|
145
|
-
<li>Make yard document rspec matchers</li>
|
146
|
-
<li>Use matcher with RSpec::Matchers:DSL</li>
|
147
|
-
<li>Add contributors</li>
|
148
|
-
</ul>
|
146
|
+
<p>So far the code base is a joined effort by everyone at Elabs.</p>
|
149
147
|
|
150
148
|
<h2>License:</h2>
|
151
149
|
|
@@ -155,7 +153,7 @@ end
|
|
155
153
|
|
156
154
|
<p>Permission is hereby granted, free of charge, to any person obtaining
|
157
155
|
a copy of this software and associated documentation files (the
|
158
|
-
|
156
|
+
"Software"), to deal in the Software without restriction, including
|
159
157
|
without limitation the rights to use, copy, modify, merge, publish,
|
160
158
|
distribute, sublicense, and/or sell copies of the Software, and to
|
161
159
|
permit persons to whom the Software is furnished to do so, subject to
|
@@ -164,7 +162,7 @@ end
|
|
164
162
|
<p>The above copyright notice and this permission notice shall be
|
165
163
|
included in all copies or substantial portions of the Software.</p>
|
166
164
|
|
167
|
-
<p>THE SOFTWARE IS PROVIDED
|
165
|
+
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
168
166
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
169
167
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
170
168
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
@@ -172,11 +170,11 @@ end
|
|
172
170
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
173
171
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
|
174
172
|
</div></div>
|
175
|
-
|
173
|
+
|
176
174
|
<div id="footer">
|
177
|
-
Generated on
|
175
|
+
Generated on Wed Sep 19 15:04:26 2012 by
|
178
176
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
179
|
-
0.
|
177
|
+
0.8.2.1 (ruby-1.9.3).
|
180
178
|
</div>
|
181
179
|
|
182
180
|
</body>
|