rspec-html-matchers 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -1
- data/README.md +1 -0
- data/lib/rspec-html-matchers.rb +2 -2
- data/rspec-html-matchers.gemspec +3 -4
- data/spec/matchers/have_tag_spec.rb +24 -4
- metadata +37 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae62c873742a46c8fb8cc012dcdd382742d3c814
|
4
|
+
data.tar.gz: 826dbb0dd8359796f7820b8d22823459e5d6dc1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21f872d52bbff456fc1ea07ede21f715832a65fc91eba3810697b23dece8747e8388a7901b93cd6d80efe2b0db34c34fe9a8059f63441d521c4fab01af1df751
|
7
|
+
data.tar.gz: 0e689393aacbf4db06ffdcfb1069f739c85571a3c42d01619c7591972817a06b918ce464160613434f93bed47b5495aa5b74c8ff8c10f755e5d90d3d2909a63d
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -3,6 +3,7 @@ rspec-html-matchers
|
|
3
3
|
|
4
4
|
[RSpec 2](https://www.relishapp.com/rspec) matchers for testing your html.
|
5
5
|
|
6
|
+
[![Gem Version](https://badge.fury.io/rb/rspec-html-matchers.png)](http://badge.fury.io/rb/rspec-html-matchers)
|
6
7
|
[![Build Status](https://travis-ci.org/kucaahbe/rspec-html-matchers.png)](http://travis-ci.org/kucaahbe/rspec-html-matchers)
|
7
8
|
|
8
9
|
Goals
|
data/lib/rspec-html-matchers.rb
CHANGED
@@ -94,7 +94,7 @@ module RSpec
|
|
94
94
|
def matches? document, &block
|
95
95
|
@block = block if block
|
96
96
|
|
97
|
-
document = document.html if defined?(Capybara) && document.is_a?(Capybara::Session)
|
97
|
+
document = document.html if defined?(Capybara::Session) && document.is_a?(Capybara::Session)
|
98
98
|
|
99
99
|
case document
|
100
100
|
when String
|
@@ -259,7 +259,7 @@ module RSpec
|
|
259
259
|
# '<div class="one two">'.should have_tag('div', :with => { :class => 'two one' })
|
260
260
|
def have_tag tag, options={}, &block
|
261
261
|
# for backwards compatibility with rpecs have tag:
|
262
|
-
options = { :text => options } if options.kind_of?
|
262
|
+
options = { :text => options } if options.kind_of?(String) || options.kind_of?(Regexp)
|
263
263
|
@__current_scope_for_nokogiri_matcher = NokogiriMatcher.new(tag, options, &block)
|
264
264
|
end
|
265
265
|
|
data/rspec-html-matchers.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'rspec-html-matchers'
|
6
|
-
s.version = '0.4.
|
6
|
+
s.version = '0.4.4'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ['kucaahbe']
|
9
9
|
s.email = ['kucaahbe@ukr.net']
|
@@ -21,8 +21,8 @@ DESC
|
|
21
21
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
22
|
s.require_paths = ["lib"]
|
23
23
|
|
24
|
-
s.
|
25
|
-
s.
|
24
|
+
s.add_runtime_dependency 'rspec', '~> 2', '>= 2.11.0'
|
25
|
+
s.add_runtime_dependency 'nokogiri', '~> 1'
|
26
26
|
|
27
27
|
s.add_development_dependency 'simplecov'
|
28
28
|
s.add_development_dependency 'cucumber'
|
@@ -30,6 +30,5 @@ DESC
|
|
30
30
|
s.add_development_dependency 'selenium-webdriver'
|
31
31
|
s.add_development_dependency 'sinatra'
|
32
32
|
s.add_development_dependency 'rake'
|
33
|
-
s.add_development_dependency 'rspec', '>= 2.11.0' # in order to use new expect().to syntax
|
34
33
|
s.add_development_dependency 'travis-lint'
|
35
34
|
end
|
@@ -235,10 +235,6 @@ describe 'have_tag' do
|
|
235
235
|
rendered.should have_tag('pre', :text => " 1. bla \n 2. bla ")
|
236
236
|
end
|
237
237
|
|
238
|
-
it "should map a string argument to :text => string" do
|
239
|
-
rendered.should have_tag('div', 'sample text')
|
240
|
-
end
|
241
|
-
|
242
238
|
it "should find with unicode text specified" do
|
243
239
|
expect { rendered.should have_tag('a', :text => "học") }.not_to raise_error
|
244
240
|
rendered.should have_tag('a', :text => "học")
|
@@ -501,4 +497,28 @@ describe 'have_tag' do
|
|
501
497
|
}.to raise_spec_error(/\/SAMPLE text\/i regexp expected within "li" in following template:\n#{ordered_list_regexp}/)
|
502
498
|
end
|
503
499
|
end
|
500
|
+
|
501
|
+
context "backwards compatibility for unnamed arguments" do
|
502
|
+
asset 'quotes'
|
503
|
+
|
504
|
+
context "string as second argument" do
|
505
|
+
|
506
|
+
it "should map a string argument to :text => string" do
|
507
|
+
rendered.should have_tag('div', 'sample text')
|
508
|
+
end
|
509
|
+
|
510
|
+
end
|
511
|
+
|
512
|
+
context "Regexp as second argument" do
|
513
|
+
|
514
|
+
it "should match against a valid Regexp" do
|
515
|
+
rendered.should have_tag('div', /sample\s/)
|
516
|
+
end
|
517
|
+
|
518
|
+
it "should not match against an invalid Regexp" do
|
519
|
+
rendered.should_not have_tag('div', /not matching/)
|
520
|
+
end
|
521
|
+
end
|
522
|
+
end
|
523
|
+
|
504
524
|
end
|
metadata
CHANGED
@@ -1,153 +1,145 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-html-matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kucaahbe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2
|
19
|
+
version: '2'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 2.11.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2
|
29
|
+
version: '2'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 2.11.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: nokogiri
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- -
|
37
|
+
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1
|
39
|
+
version: '1'
|
34
40
|
type: :runtime
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
|
-
- -
|
44
|
+
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1
|
46
|
+
version: '1'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: simplecov
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
|
-
- -
|
51
|
+
- - ">="
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
|
-
- -
|
58
|
+
- - ">="
|
53
59
|
- !ruby/object:Gem::Version
|
54
60
|
version: '0'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: cucumber
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
58
64
|
requirements:
|
59
|
-
- -
|
65
|
+
- - ">="
|
60
66
|
- !ruby/object:Gem::Version
|
61
67
|
version: '0'
|
62
68
|
type: :development
|
63
69
|
prerelease: false
|
64
70
|
version_requirements: !ruby/object:Gem::Requirement
|
65
71
|
requirements:
|
66
|
-
- -
|
72
|
+
- - ">="
|
67
73
|
- !ruby/object:Gem::Version
|
68
74
|
version: '0'
|
69
75
|
- !ruby/object:Gem::Dependency
|
70
76
|
name: capybara
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
72
78
|
requirements:
|
73
|
-
- -
|
79
|
+
- - ">="
|
74
80
|
- !ruby/object:Gem::Version
|
75
81
|
version: '0'
|
76
82
|
type: :development
|
77
83
|
prerelease: false
|
78
84
|
version_requirements: !ruby/object:Gem::Requirement
|
79
85
|
requirements:
|
80
|
-
- -
|
86
|
+
- - ">="
|
81
87
|
- !ruby/object:Gem::Version
|
82
88
|
version: '0'
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
90
|
name: selenium-webdriver
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
86
92
|
requirements:
|
87
|
-
- -
|
93
|
+
- - ">="
|
88
94
|
- !ruby/object:Gem::Version
|
89
95
|
version: '0'
|
90
96
|
type: :development
|
91
97
|
prerelease: false
|
92
98
|
version_requirements: !ruby/object:Gem::Requirement
|
93
99
|
requirements:
|
94
|
-
- -
|
100
|
+
- - ">="
|
95
101
|
- !ruby/object:Gem::Version
|
96
102
|
version: '0'
|
97
103
|
- !ruby/object:Gem::Dependency
|
98
104
|
name: sinatra
|
99
105
|
requirement: !ruby/object:Gem::Requirement
|
100
106
|
requirements:
|
101
|
-
- -
|
107
|
+
- - ">="
|
102
108
|
- !ruby/object:Gem::Version
|
103
109
|
version: '0'
|
104
110
|
type: :development
|
105
111
|
prerelease: false
|
106
112
|
version_requirements: !ruby/object:Gem::Requirement
|
107
113
|
requirements:
|
108
|
-
- -
|
114
|
+
- - ">="
|
109
115
|
- !ruby/object:Gem::Version
|
110
116
|
version: '0'
|
111
117
|
- !ruby/object:Gem::Dependency
|
112
118
|
name: rake
|
113
119
|
requirement: !ruby/object:Gem::Requirement
|
114
120
|
requirements:
|
115
|
-
- -
|
121
|
+
- - ">="
|
116
122
|
- !ruby/object:Gem::Version
|
117
123
|
version: '0'
|
118
124
|
type: :development
|
119
125
|
prerelease: false
|
120
126
|
version_requirements: !ruby/object:Gem::Requirement
|
121
127
|
requirements:
|
122
|
-
- -
|
128
|
+
- - ">="
|
123
129
|
- !ruby/object:Gem::Version
|
124
130
|
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: rspec
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - '>='
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 2.11.0
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - '>='
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 2.11.0
|
139
131
|
- !ruby/object:Gem::Dependency
|
140
132
|
name: travis-lint
|
141
133
|
requirement: !ruby/object:Gem::Requirement
|
142
134
|
requirements:
|
143
|
-
- -
|
135
|
+
- - ">="
|
144
136
|
- !ruby/object:Gem::Version
|
145
137
|
version: '0'
|
146
138
|
type: :development
|
147
139
|
prerelease: false
|
148
140
|
version_requirements: !ruby/object:Gem::Requirement
|
149
141
|
requirements:
|
150
|
-
- -
|
142
|
+
- - ">="
|
151
143
|
- !ruby/object:Gem::Version
|
152
144
|
version: '0'
|
153
145
|
description: |
|
@@ -158,10 +150,10 @@ executables: []
|
|
158
150
|
extensions: []
|
159
151
|
extra_rdoc_files: []
|
160
152
|
files:
|
161
|
-
- .gitignore
|
162
|
-
- .rspec
|
163
|
-
- .travis.yml
|
164
|
-
- .yardopts
|
153
|
+
- ".gitignore"
|
154
|
+
- ".rspec"
|
155
|
+
- ".travis.yml"
|
156
|
+
- ".yardopts"
|
165
157
|
- CHANGELOG.md
|
166
158
|
- Gemfile
|
167
159
|
- README.md
|
@@ -192,17 +184,17 @@ require_paths:
|
|
192
184
|
- lib
|
193
185
|
required_ruby_version: !ruby/object:Gem::Requirement
|
194
186
|
requirements:
|
195
|
-
- -
|
187
|
+
- - ">="
|
196
188
|
- !ruby/object:Gem::Version
|
197
189
|
version: '0'
|
198
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
199
191
|
requirements:
|
200
|
-
- -
|
192
|
+
- - ">="
|
201
193
|
- !ruby/object:Gem::Version
|
202
194
|
version: '0'
|
203
195
|
requirements: []
|
204
196
|
rubyforge_project: rspec-html-matchers
|
205
|
-
rubygems_version: 2.0
|
197
|
+
rubygems_version: 2.2.0
|
206
198
|
signing_key:
|
207
199
|
specification_version: 4
|
208
200
|
summary: Nokogiri based 'have_tag' and 'with_tag' matchers for rspec 2.x.x
|