kelp 0.1.9 → 0.2.0
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/Gemfile.lock +1 -1
- data/History.md +10 -0
- data/examples/sinatra_app/features/checkbox_fail.feature +11 -0
- data/examples/sinatra_app/features/dropdown.feature +4 -4
- data/examples/sinatra_app/features/dropdown_fail.feature +28 -0
- data/examples/sinatra_app/features/field.feature +57 -0
- data/examples/sinatra_app/features/field_fail.feature +31 -0
- data/examples/sinatra_app/features/visibility.feature +96 -6
- data/examples/sinatra_app/features/visibility_fail.feature +30 -2
- data/examples/sinatra_app/views/form.erb +14 -0
- data/features/kelp_step_definitions.feature +101 -12
- data/features/step_definitions/app_steps.rb +24 -8
- data/kelp.gemspec +1 -1
- data/lib/kelp.rb +0 -15
- data/lib/kelp/attribute.rb +26 -4
- data/lib/kelp/checkbox.rb +33 -8
- data/lib/kelp/dropdown.rb +37 -11
- data/lib/kelp/exceptions.rb +4 -2
- data/lib/kelp/field.rb +80 -41
- data/lib/kelp/helper.rb +8 -1
- data/lib/kelp/navigation.rb +14 -8
- data/lib/kelp/scoping.rb +1 -3
- data/lib/kelp/visibility.rb +152 -167
- data/rails_generators/kelp/templates/web_steps.rb +2 -2
- data/spec/attribute_spec.rb +4 -4
- data/spec/checkbox_spec.rb +4 -4
- data/spec/dropdown_spec.rb +10 -10
- data/spec/field_spec.rb +15 -15
- data/spec/navigation_spec.rb +2 -2
- data/spec/spec_helper.rb +0 -9
- data/spec/visibility_spec.rb +40 -103
- metadata +8 -5
@@ -28,7 +28,7 @@ World(Kelp::Visibility)
|
|
28
28
|
I = /(?:|I )/
|
29
29
|
TEXT = /"([^\"]+)"/
|
30
30
|
REGEX = /\/([^\/]*)\//
|
31
|
-
WITHIN = /(?: within (
|
31
|
+
WITHIN = /(?: within "?([^\"]+)"?)?/
|
32
32
|
ELEMENT = /(?:field|checkbox|dropdown|button)/
|
33
33
|
|
34
34
|
|
@@ -303,7 +303,7 @@ end
|
|
303
303
|
# | Hair | blonde |
|
304
304
|
# | Has TV show | checked |
|
305
305
|
#
|
306
|
-
When /^#{I}fill in the following#{WITHIN}:$/ do |
|
306
|
+
When /^#{I}fill in the following#{WITHIN}:$/ do |selector, fields|
|
307
307
|
fill_in_fields(fields.rows_hash, :within => selector)
|
308
308
|
end
|
309
309
|
|
data/spec/attribute_spec.rb
CHANGED
@@ -15,13 +15,13 @@ describe Kelp::Attribute, "should_be_disabled" do
|
|
15
15
|
it "element does not exist" do
|
16
16
|
lambda do
|
17
17
|
should_be_disabled "nonexistent"
|
18
|
-
end.should raise_error(
|
18
|
+
end.should raise_error(Kelp::Unexpected)
|
19
19
|
end
|
20
20
|
|
21
21
|
it "element does not have the disabled attribute" do
|
22
22
|
lambda do
|
23
23
|
should_be_disabled "first_name"
|
24
|
-
end.should raise_error(
|
24
|
+
end.should raise_error(Kelp::Unexpected)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -42,13 +42,13 @@ describe Kelp::Attribute, "should_be_enabled" do
|
|
42
42
|
it "element does not exist" do
|
43
43
|
lambda do
|
44
44
|
should_be_enabled "nonexistent"
|
45
|
-
end.should raise_error(
|
45
|
+
end.should raise_error(Kelp::Unexpected)
|
46
46
|
end
|
47
47
|
|
48
48
|
it "element has the disabled attribute" do
|
49
49
|
lambda do
|
50
50
|
should_be_enabled "readonly"
|
51
|
-
end.should raise_error(
|
51
|
+
end.should raise_error(Kelp::Unexpected)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
data/spec/checkbox_spec.rb
CHANGED
@@ -20,14 +20,14 @@ describe Kelp::Checkbox, "checkbox_should_be_checked" do
|
|
20
20
|
it "the checkbox is unchecked by default" do
|
21
21
|
lambda do
|
22
22
|
checkbox_should_be_checked "I like salami"
|
23
|
-
end.should raise_error
|
23
|
+
end.should raise_error(Kelp::Unexpected)
|
24
24
|
end
|
25
25
|
|
26
26
|
it "the checkbox is unchecked programmatically" do
|
27
27
|
uncheck "I like cheese"
|
28
28
|
lambda do
|
29
29
|
checkbox_should_be_checked "I like cheese"
|
30
|
-
end.should raise_error
|
30
|
+
end.should raise_error(Kelp::Unexpected)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -54,14 +54,14 @@ describe Kelp::Checkbox, "checkbox_should_not_be_checked" do
|
|
54
54
|
it "the checkbox is checked by default" do
|
55
55
|
lambda do
|
56
56
|
checkbox_should_not_be_checked "I like cheese"
|
57
|
-
end.should raise_error
|
57
|
+
end.should raise_error(Kelp::Unexpected)
|
58
58
|
end
|
59
59
|
|
60
60
|
it "the checkbox is checked programmatically" do
|
61
61
|
check "I like salami"
|
62
62
|
lambda do
|
63
63
|
checkbox_should_not_be_checked "I like salami"
|
64
|
-
end.should raise_error
|
64
|
+
end.should raise_error(Kelp::Unexpected)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
data/spec/dropdown_spec.rb
CHANGED
@@ -27,20 +27,20 @@ describe Kelp::Dropdown, "dropdown_should_equal" do
|
|
27
27
|
it "the option does not have the 'selected' attribute" do
|
28
28
|
lambda do
|
29
29
|
dropdown_should_equal "Height", "Tall"
|
30
|
-
end.should raise_error(
|
30
|
+
end.should raise_error(Kelp::Unexpected)
|
31
31
|
end
|
32
32
|
|
33
33
|
it "the option is not the first one selected by default" do
|
34
34
|
lambda do
|
35
35
|
dropdown_should_equal "Weight", "Medium"
|
36
|
-
end.should raise_error(
|
36
|
+
end.should raise_error(Kelp::Unexpected)
|
37
37
|
end
|
38
38
|
|
39
39
|
it "the option was not the one chosen programmatically" do
|
40
40
|
select "Tall", :from => "Height"
|
41
41
|
lambda do
|
42
42
|
dropdown_should_equal "Height", "Average"
|
43
|
-
end.should raise_error(
|
43
|
+
end.should raise_error(Kelp::Unexpected)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -78,7 +78,7 @@ describe Kelp::Dropdown, "dropdown_should_include" do
|
|
78
78
|
it "a single option does not exist in the dropdown" do
|
79
79
|
lambda do
|
80
80
|
dropdown_should_include "Height", "Midget"
|
81
|
-
end.should raise_error(
|
81
|
+
end.should raise_error(Kelp::Unexpected)
|
82
82
|
end
|
83
83
|
|
84
84
|
it "any of several options do not exist in the dropdown" do
|
@@ -89,7 +89,7 @@ describe Kelp::Dropdown, "dropdown_should_include" do
|
|
89
89
|
"Tall",
|
90
90
|
"Giant",
|
91
91
|
]
|
92
|
-
end.should raise_error(
|
92
|
+
end.should raise_error(Kelp::Unexpected)
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
@@ -120,7 +120,7 @@ describe Kelp::Dropdown, "dropdown_should_not_include" do
|
|
120
120
|
it "a single option exists in the dropdown" do
|
121
121
|
lambda do
|
122
122
|
dropdown_should_not_include "Height", "Short"
|
123
|
-
end.should raise_error(
|
123
|
+
end.should raise_error(Kelp::Unexpected)
|
124
124
|
end
|
125
125
|
|
126
126
|
it "any of several options exist in the dropdown" do
|
@@ -131,7 +131,7 @@ describe Kelp::Dropdown, "dropdown_should_not_include" do
|
|
131
131
|
"Behemoth",
|
132
132
|
"Tall",
|
133
133
|
]
|
134
|
-
end.should raise_error(
|
134
|
+
end.should raise_error(Kelp::Unexpected)
|
135
135
|
end
|
136
136
|
end
|
137
137
|
end
|
@@ -161,20 +161,20 @@ describe Kelp::Dropdown, "dropdown_value_should_equal" do
|
|
161
161
|
it "the option with the 'selected' attribute has a different value" do
|
162
162
|
lambda do
|
163
163
|
dropdown_value_should_equal "Height", "99"
|
164
|
-
end.should raise_error(
|
164
|
+
end.should raise_error(Kelp::Unexpected)
|
165
165
|
end
|
166
166
|
|
167
167
|
it "the first option selected by default does not have given value" do
|
168
168
|
lambda do
|
169
169
|
dropdown_value_should_equal "Weight", "2"
|
170
|
-
end.should raise_error(
|
170
|
+
end.should raise_error(Kelp::Unexpected)
|
171
171
|
end
|
172
172
|
|
173
173
|
it "the programmatically chosen option has a different value" do
|
174
174
|
select "Tall", :from => "Height"
|
175
175
|
lambda do
|
176
176
|
dropdown_value_should_equal "Height", "2"
|
177
|
-
end.should raise_error(
|
177
|
+
end.should raise_error(Kelp::Unexpected)
|
178
178
|
end
|
179
179
|
end
|
180
180
|
end
|
data/spec/field_spec.rb
CHANGED
@@ -29,7 +29,7 @@ describe Kelp::Field, "field_should_be_empty" do
|
|
29
29
|
fill_in "first_name", :with => "Brian"
|
30
30
|
lambda do
|
31
31
|
field_should_be_empty "first_name"
|
32
|
-
end.should raise_error(
|
32
|
+
end.should raise_error(Kelp::Unexpected)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -38,7 +38,7 @@ describe Kelp::Field, "field_should_be_empty" do
|
|
38
38
|
fill_in "First name", :with => "Brian"
|
39
39
|
lambda do
|
40
40
|
field_should_be_empty "First name"
|
41
|
-
end.should raise_error(
|
41
|
+
end.should raise_error(Kelp::Unexpected)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -71,14 +71,14 @@ describe Kelp::Field, "field_should_contain" do
|
|
71
71
|
it "is empty" do
|
72
72
|
lambda do
|
73
73
|
field_should_contain "first_name", "Brian"
|
74
|
-
end.should raise_error(
|
74
|
+
end.should raise_error(Kelp::Unexpected)
|
75
75
|
end
|
76
76
|
|
77
77
|
it "has a different value" do
|
78
78
|
fill_in "first_name", :with => "Judith"
|
79
79
|
lambda do
|
80
80
|
field_should_contain "first_name", "Brian"
|
81
|
-
end.should raise_error(
|
81
|
+
end.should raise_error(Kelp::Unexpected)
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
@@ -86,14 +86,14 @@ describe Kelp::Field, "field_should_contain" do
|
|
86
86
|
it "is empty" do
|
87
87
|
lambda do
|
88
88
|
field_should_contain "First name", "Brian"
|
89
|
-
end.should raise_error(
|
89
|
+
end.should raise_error(Kelp::Unexpected)
|
90
90
|
end
|
91
91
|
|
92
92
|
it "has a different value" do
|
93
93
|
fill_in "First name", :with => "Judith"
|
94
94
|
lambda do
|
95
95
|
field_should_contain "First name", "Brian"
|
96
|
-
end.should raise_error(
|
96
|
+
end.should raise_error(Kelp::Unexpected)
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
@@ -154,7 +154,7 @@ describe Kelp::Field, "fields_should_contain" do
|
|
154
154
|
it "are empty" do
|
155
155
|
lambda do
|
156
156
|
fields_should_contain "first_name" => "Terry", "last_name" => "Jones"
|
157
|
-
end.should raise_error(
|
157
|
+
end.should raise_error(Kelp::Unexpected)
|
158
158
|
end
|
159
159
|
|
160
160
|
it "do not all match" do
|
@@ -162,7 +162,7 @@ describe Kelp::Field, "fields_should_contain" do
|
|
162
162
|
fill_in "last_name", :with => "Gilliam"
|
163
163
|
lambda do
|
164
164
|
fields_should_contain "first_name" => "Terry", "last_name" => "Jones"
|
165
|
-
end.should raise_error(
|
165
|
+
end.should raise_error(Kelp::Unexpected)
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|
@@ -170,7 +170,7 @@ describe Kelp::Field, "fields_should_contain" do
|
|
170
170
|
it "are empty" do
|
171
171
|
lambda do
|
172
172
|
fields_should_contain "First name" => "Terry", "Last name" => "Jones"
|
173
|
-
end.should raise_error(
|
173
|
+
end.should raise_error(Kelp::Unexpected)
|
174
174
|
end
|
175
175
|
|
176
176
|
it "do not all match" do
|
@@ -178,7 +178,7 @@ describe Kelp::Field, "fields_should_contain" do
|
|
178
178
|
fill_in "Last name", :with => "Gilliam"
|
179
179
|
lambda do
|
180
180
|
fields_should_contain "First name" => "Terry", "Last name" => "Jones"
|
181
|
-
end.should raise_error(
|
181
|
+
end.should raise_error(Kelp::Unexpected)
|
182
182
|
end
|
183
183
|
end
|
184
184
|
|
@@ -229,19 +229,19 @@ describe Kelp::Field, "fill_in_field" do
|
|
229
229
|
it "filling a nonexistent field" do
|
230
230
|
lambda do
|
231
231
|
fill_in_field "Middle name", "Kaminsky"
|
232
|
-
end.should raise_error(
|
232
|
+
end.should raise_error(Kelp::FieldNotFound)
|
233
233
|
end
|
234
234
|
|
235
235
|
it "selecting a nonexistent value from a dropdown" do
|
236
236
|
lambda do
|
237
237
|
fill_in_field "Height", "Gigantic"
|
238
|
-
end.should raise_error(
|
238
|
+
end.should raise_error(Kelp::OptionNotFound)
|
239
239
|
end
|
240
240
|
|
241
241
|
it "filling a field in the wrong scope" do
|
242
242
|
lambda do
|
243
243
|
fill_in_field_within "#preferences_form", "First name", "Mel"
|
244
|
-
end.should raise_error(
|
244
|
+
end.should raise_error(Kelp::FieldNotFound)
|
245
245
|
end
|
246
246
|
end
|
247
247
|
end
|
@@ -316,14 +316,14 @@ describe Kelp::Field, "fill_in_fields" do
|
|
316
316
|
it "filling a nonexistent field" do
|
317
317
|
lambda do
|
318
318
|
fill_in_fields "Middle name" => "Kaminsky"
|
319
|
-
end.should raise_error(
|
319
|
+
end.should raise_error(Kelp::FieldNotFound)
|
320
320
|
end
|
321
321
|
|
322
322
|
it "filling a field in the wrong scope" do
|
323
323
|
lambda do
|
324
324
|
fill_in_fields_within "#preferences_form",
|
325
325
|
"First name" => "Mel"
|
326
|
-
end.should raise_error(
|
326
|
+
end.should raise_error(Kelp::FieldNotFound)
|
327
327
|
end
|
328
328
|
end
|
329
329
|
|
data/spec/navigation_spec.rb
CHANGED
@@ -102,7 +102,7 @@ describe Kelp::Navigation, "should_be_on_page" do
|
|
102
102
|
visit('/home')
|
103
103
|
lambda do
|
104
104
|
should_be_on_page '/form'
|
105
|
-
end.should raise_error(
|
105
|
+
end.should raise_error(Kelp::Unexpected)
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
@@ -124,7 +124,7 @@ describe Kelp::Navigation, "should_have_query" do
|
|
124
124
|
it "expected params when actual query is empty" do
|
125
125
|
lambda do
|
126
126
|
should_have_query :username => 'tony'
|
127
|
-
end.should raise_error(
|
127
|
+
end.should raise_error(Kelp::Unexpected)
|
128
128
|
end
|
129
129
|
end
|
130
130
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,16 +1,12 @@
|
|
1
1
|
require 'rspec'
|
2
|
-
|
3
|
-
# Supported drivers
|
4
2
|
require 'capybara'
|
5
3
|
require 'capybara/dsl'
|
6
|
-
#require 'webrat'
|
7
4
|
|
8
5
|
require 'kelp'
|
9
6
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'examples', 'sinatra_app', 'app'))
|
10
7
|
|
11
8
|
RSpec.configure do |config|
|
12
9
|
config.include Capybara
|
13
|
-
#config.include Webrat::Methods
|
14
10
|
|
15
11
|
config.include Kelp::Attribute
|
16
12
|
config.include Kelp::Checkbox
|
@@ -21,7 +17,6 @@ RSpec.configure do |config|
|
|
21
17
|
config.include Kelp::Visibility
|
22
18
|
|
23
19
|
config.before do
|
24
|
-
#Kelp.driver = :webrat
|
25
20
|
Capybara.default_driver = :rack_test
|
26
21
|
Capybara.default_selector = :css
|
27
22
|
Capybara.app = TestApp
|
@@ -33,7 +28,3 @@ RSpec.configure do |config|
|
|
33
28
|
end
|
34
29
|
end
|
35
30
|
|
36
|
-
#Webrat.configure do |config|
|
37
|
-
#config.mode = :rack
|
38
|
-
#end
|
39
|
-
|
data/spec/visibility_spec.rb
CHANGED
@@ -1,5 +1,40 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
2
|
|
3
|
+
describe Kelp::Visibility, "page_contains?" do
|
4
|
+
before(:each) do
|
5
|
+
visit('/home')
|
6
|
+
end
|
7
|
+
|
8
|
+
context "returns true when" do
|
9
|
+
it "String exists" do
|
10
|
+
page_contains?("Hello world").should be_true
|
11
|
+
end
|
12
|
+
|
13
|
+
it "Regexp matches" do
|
14
|
+
page_contains?(/(Hello|Goodbye) world/).should be_true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context "returns false when" do
|
19
|
+
it "String does not exist" do
|
20
|
+
page_contains?("Jimmy eat world").should be_false
|
21
|
+
end
|
22
|
+
|
23
|
+
it "Regexp does not match" do
|
24
|
+
page_contains?(/(Ni-hao|Konnichiwa) world/).should be_false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context "raises exception when" do
|
29
|
+
it "invalid argument type is given" do
|
30
|
+
lambda do
|
31
|
+
page_contains?(1234)
|
32
|
+
end.should raise_error(ArgumentError)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
|
3
38
|
describe Kelp::Visibility, "should_see" do
|
4
39
|
before(:each) do
|
5
40
|
visit('/home')
|
@@ -238,19 +273,19 @@ describe Kelp::Visibility, "should_see_in_same_row" do
|
|
238
273
|
it "two strings exist, but are not in the same row" do
|
239
274
|
lambda do
|
240
275
|
should_see_in_same_row ["Eric", "John"]
|
241
|
-
end.should raise_error(
|
276
|
+
end.should raise_error(Kelp::Unexpected)
|
242
277
|
end
|
243
278
|
|
244
279
|
it "two strings are in the same row, but a third is not" do
|
245
280
|
lambda do
|
246
281
|
should_see_in_same_row ["Eric", "Edit", "Delete"]
|
247
|
-
end.should raise_error(
|
282
|
+
end.should raise_error(Kelp::Unexpected)
|
248
283
|
end
|
249
284
|
|
250
285
|
it "two strings are in the same row, but outside the given scope" do
|
251
286
|
lambda do
|
252
287
|
should_see_in_same_row ["Eric", "Edit"], :within => "#table_b"
|
253
|
-
end.should raise_error(
|
288
|
+
end.should raise_error(Kelp::Unexpected)
|
254
289
|
end
|
255
290
|
end
|
256
291
|
end
|
@@ -282,113 +317,15 @@ describe Kelp::Visibility, "should_not_see_in_same_row" do
|
|
282
317
|
it "two strings are in the same row" do
|
283
318
|
lambda do
|
284
319
|
should_not_see_in_same_row ["Eric", "Edit"]
|
285
|
-
end.should raise_error(
|
320
|
+
end.should raise_error(Kelp::Unexpected)
|
286
321
|
end
|
287
322
|
|
288
323
|
it "two strings are in the same row within a given scope" do
|
289
324
|
lambda do
|
290
325
|
should_not_see_in_same_row ["Eric", "Edit"], :within => "#table_a"
|
291
|
-
end.should raise_error(
|
292
|
-
end
|
293
|
-
end
|
294
|
-
end
|
295
|
-
|
296
|
-
|
297
|
-
describe Kelp::Visibility, "page_should_contain" do
|
298
|
-
before(:each) do
|
299
|
-
visit('/home')
|
300
|
-
end
|
301
|
-
|
302
|
-
context "passes when" do
|
303
|
-
context "String" do
|
304
|
-
it "exists" do
|
305
|
-
page_should_contain "Hello world"
|
306
|
-
page_should_contain "Goodbye world"
|
307
|
-
end
|
308
|
-
end
|
309
|
-
context "Regexp" do
|
310
|
-
it "matches" do
|
311
|
-
page_should_contain /(Hello|Goodbye) world/
|
312
|
-
page_should_contain /\d\d\d-\d\d\d\d/
|
313
|
-
end
|
314
|
-
end
|
315
|
-
end
|
316
|
-
|
317
|
-
context "fails when" do
|
318
|
-
context "String" do
|
319
|
-
it "does not exist" do
|
320
|
-
lambda do
|
321
|
-
page_should_contain "Wazzup world"
|
322
|
-
end.should raise_error(rspec_unexpected)
|
323
|
-
end
|
324
|
-
end
|
325
|
-
|
326
|
-
context "Regexp" do
|
327
|
-
it "does not match" do
|
328
|
-
lambda do
|
329
|
-
page_should_contain /(Foo|Bar|Baz) world/
|
330
|
-
end.should raise_error(rspec_unexpected)
|
331
|
-
end
|
332
|
-
end
|
333
|
-
|
334
|
-
it "not a String or Regexp" do
|
335
|
-
lambda do
|
336
|
-
page_should_contain 123
|
337
|
-
end.should raise_error(ArgumentError)
|
338
|
-
end
|
339
|
-
end
|
340
|
-
|
341
|
-
end
|
342
|
-
|
343
|
-
|
344
|
-
describe Kelp::Visibility, "page_should_not_contain" do
|
345
|
-
before(:each) do
|
346
|
-
visit('/home')
|
347
|
-
end
|
348
|
-
|
349
|
-
context "passes when" do
|
350
|
-
context "String" do
|
351
|
-
it "does not exist" do
|
352
|
-
page_should_not_contain "Wazzup world"
|
353
|
-
end
|
354
|
-
end
|
355
|
-
|
356
|
-
context "Regexp" do
|
357
|
-
it "does not match" do
|
358
|
-
page_should_not_contain /(Foo|Bar|Baz) world/
|
359
|
-
end
|
360
|
-
end
|
361
|
-
end
|
362
|
-
|
363
|
-
context "fails when" do
|
364
|
-
context "String" do
|
365
|
-
it "exists" do
|
366
|
-
lambda do
|
367
|
-
page_should_not_contain "Hello world"
|
368
|
-
end.should raise_error(rspec_unexpected)
|
369
|
-
lambda do
|
370
|
-
page_should_not_contain "Goodbye world"
|
371
|
-
end.should raise_error(rspec_unexpected)
|
372
|
-
end
|
373
|
-
end
|
374
|
-
context "Regexp" do
|
375
|
-
it "matches" do
|
376
|
-
lambda do
|
377
|
-
page_should_not_contain /(Hello|Goodbye) world/
|
378
|
-
end.should raise_error(rspec_unexpected)
|
379
|
-
lambda do
|
380
|
-
page_should_not_contain /\d\d\d-\d\d\d\d/
|
381
|
-
end.should raise_error(rspec_unexpected)
|
382
|
-
end
|
383
|
-
end
|
384
|
-
|
385
|
-
it "not a String or Regexp" do
|
386
|
-
lambda do
|
387
|
-
page_should_not_contain 123
|
388
|
-
end.should raise_error(ArgumentError)
|
326
|
+
end.should raise_error(Kelp::Unexpected)
|
389
327
|
end
|
390
328
|
end
|
391
|
-
|
392
329
|
end
|
393
330
|
|
394
331
|
|