spreewald 0.5.2 → 0.5.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/README.md +1 -1
- data/lib/spreewald/web_steps.rb +6 -17
- data/lib/spreewald_support/custom_matchers.rb +22 -0
- data/lib/spreewald_support/version.rb +1 -1
- metadata +76 -61
data/README.md
CHANGED
@@ -298,7 +298,7 @@ deprecation notice. Decide for yourself whether you want to use them:
|
|
298
298
|
|
299
299
|
* **Then the "..." field( within ...)? should contain "..."**
|
300
300
|
|
301
|
-
Checks that
|
301
|
+
Checks that an input field contains some value (allowing * as wildcard character)
|
302
302
|
|
303
303
|
|
304
304
|
* **Then the "..." field( within ...)? should not contain "..."**
|
data/lib/spreewald/web_steps.rb
CHANGED
@@ -26,6 +26,7 @@
|
|
26
26
|
require 'spreewald_support/tolerance_for_selenium_sync_issues'
|
27
27
|
require 'spreewald_support/path_selector_fallbacks'
|
28
28
|
require 'spreewald_support/step_fallback'
|
29
|
+
require 'spreewald_support/custom_matchers'
|
29
30
|
require 'uri'
|
30
31
|
require 'cgi'
|
31
32
|
|
@@ -144,25 +145,13 @@ Then /^(?:|I )should not see \/([^\/]*)\/$/ do |regexp|
|
|
144
145
|
end
|
145
146
|
|
146
147
|
|
147
|
-
# Checks that
|
148
|
-
Then /^the "([^"]*)" field
|
148
|
+
# Checks that an input field contains some value (allowing * as wildcard character)
|
149
|
+
Then /^the "([^"]*)" field should (not )?contain "([^"]*)"$/ do |field, negate, expected_string|
|
149
150
|
patiently do
|
150
|
-
|
151
|
-
|
152
|
-
field_value = ((field.tag_name == 'textarea') && field.text.present?) ? field.text : field.value
|
153
|
-
field_value.should =~ /#{Regexp.escape(value)}/
|
154
|
-
end
|
155
|
-
end
|
156
|
-
end
|
151
|
+
field = find_field(field)
|
152
|
+
field_value = ((field.tag_name == 'textarea') && field.text.present?) ? field.text : field.value
|
157
153
|
|
158
|
-
|
159
|
-
Then /^the "([^"]*)" field(?: within (.*))? should not contain "([^"]*)"$/ do |field, parent, value|
|
160
|
-
patiently do
|
161
|
-
with_scope(parent) do
|
162
|
-
field = find_field(field)
|
163
|
-
field_value = (field.tag_name == 'textarea') ? field.text : field.value
|
164
|
-
field_value.should_not =~ /#{Regexp.escape(value)}/
|
165
|
-
end
|
154
|
+
field_value.send(negate ? :should_not : :should, contain_with_wildcards(expected_string))
|
166
155
|
end
|
167
156
|
end
|
168
157
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module CustomMatchers
|
2
|
+
rspec = defined?(RSpec) ? RSpec : Spec
|
3
|
+
|
4
|
+
rspec::Matchers.define :contain_with_wildcards do |expected_string|
|
5
|
+
match do |field_value|
|
6
|
+
@field_value = field_value
|
7
|
+
@expected_string = expected_string
|
8
|
+
regex_parts = expected_string.split('*', -1).collect { |part| Regexp.escape(part) }
|
9
|
+
|
10
|
+
@field_value =~ /\A#{regex_parts.join(".*")}\z/
|
11
|
+
end
|
12
|
+
|
13
|
+
failure_message_for_should do
|
14
|
+
"The field's content #@field_value did not match #@expected_string"
|
15
|
+
end
|
16
|
+
|
17
|
+
failure_message_for_should_not do
|
18
|
+
"The field's content #@field_value matches #@expected_string"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
metadata
CHANGED
@@ -1,72 +1,75 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreewald
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 5
|
9
|
+
- 3
|
10
|
+
version: 0.5.3
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Tobias Kraze
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-03-05 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: cucumber-rails
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
38
33
|
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: cucumber
|
39
37
|
prerelease: false
|
40
|
-
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
39
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
54
47
|
type: :runtime
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: capybara
|
55
51
|
prerelease: false
|
56
|
-
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
53
|
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
type: :runtime
|
62
|
+
version_requirements: *id003
|
63
|
+
description: A collection of cucumber steps we use in our projects, including steps to check HTML, tables, emails and some utility methods.
|
64
|
+
email:
|
65
65
|
- tobias@kraze.eu
|
66
66
|
executables: []
|
67
|
+
|
67
68
|
extensions: []
|
69
|
+
|
68
70
|
extra_rdoc_files: []
|
69
|
-
|
71
|
+
|
72
|
+
files:
|
70
73
|
- .gitignore
|
71
74
|
- Gemfile
|
72
75
|
- LICENSE
|
@@ -81,6 +84,7 @@ files:
|
|
81
84
|
- lib/spreewald/table_steps.rb
|
82
85
|
- lib/spreewald/timecop_steps.rb
|
83
86
|
- lib/spreewald/web_steps.rb
|
87
|
+
- lib/spreewald_support/custom_matchers.rb
|
84
88
|
- lib/spreewald_support/github.rb
|
85
89
|
- lib/spreewald_support/mail_finder.rb
|
86
90
|
- lib/spreewald_support/path_selector_fallbacks.rb
|
@@ -89,28 +93,39 @@ files:
|
|
89
93
|
- lib/spreewald_support/version.rb
|
90
94
|
- spreewald.gemspec
|
91
95
|
- support/documentation_generator.rb
|
96
|
+
has_rdoc: true
|
92
97
|
homepage: https://github.com/makandra/spreewald
|
93
98
|
licenses: []
|
99
|
+
|
94
100
|
post_install_message:
|
95
101
|
rdoc_options: []
|
96
|
-
|
102
|
+
|
103
|
+
require_paths:
|
97
104
|
- lib
|
98
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
99
106
|
none: false
|
100
|
-
requirements:
|
101
|
-
- -
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
|
104
|
-
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
hash: 3
|
111
|
+
segments:
|
112
|
+
- 0
|
113
|
+
version: "0"
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
115
|
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
hash: 3
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
version: "0"
|
110
123
|
requirements: []
|
124
|
+
|
111
125
|
rubyforge_project:
|
112
|
-
rubygems_version: 1.
|
126
|
+
rubygems_version: 1.3.9.5
|
113
127
|
signing_key:
|
114
128
|
specification_version: 3
|
115
129
|
summary: Collection of useful cucumber steps.
|
116
130
|
test_files: []
|
131
|
+
|