html5_validator 0.0.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/.gitignore +1 -2
- data/.rspec +2 -0
- data/html5_validator.gemspec +4 -3
- data/lib/html5_validator/matchers.rb +1 -1
- data/lib/html5_validator/version.rb +1 -1
- data/spec/html5_validator_spec.rb +15 -21
- data/spec/spec_helper.rb +79 -2
- metadata +33 -19
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
NWFjNGM3NDI0MzVmMzAxZjA2M2ZhMzJjZThhOGE3NmYwMDczNTM3NWFlMGIy
|
10
|
-
ZDc4ZjNjOTMxYzBkM2UzOTE4N2I5YjZiYjA3MWRjMGIyMWEyNjQ0OTBkY2I1
|
11
|
-
YWJmNTkyNTYxMWFkOTYwMzhmN2FkNzNlM2Y3MzFmM2RmNzdjMjA=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NDc1MWZjNDQ3ZGJmMmY4NzBjZGNjNDhkNzk5YjFkZTljMDI0YTJkMzljOTk0
|
14
|
-
NjY3OWM1ZDJmM2E0ZTNkMWY2YjZlOTJjNjY0ZGYwNmUyNTAxYWEyZjZkYTY5
|
15
|
-
NDg3YTVjZWE1MWI3ZjIzNjIzOWYwM2UwYjZkNzFjMmU5NTE2OWQ=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bb7e85b0484995df6b91f6bc16fc975c30a8273d
|
4
|
+
data.tar.gz: 2a4ac022caf1e7b5939a079102f526a01ac12b32
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a0b21c21832728327096a240c26cad496357ac385683f5966876da11bb8b1d89ec1708771aa6ef17ef007fdeafa03d2d18f592c612b1ca4bacfb6c39e7f1a729
|
7
|
+
data.tar.gz: 14c4e8a311ecf2628cee26de47c440c8c9360cc9f469662bc2b7ff242ecc5bdbf74fe5c42a9b85809adaf80b17bcf12c2f7c010f895a71b36c7d9c1bb963bbf6
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/html5_validator.gemspec
CHANGED
@@ -16,8 +16,9 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.files = `git ls-files`.split("\n")
|
17
17
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
-
s.add_dependency "json"
|
20
|
-
s.add_dependency "rest-client"
|
21
|
-
s.add_dependency "rspec"
|
19
|
+
s.add_dependency "json"
|
20
|
+
s.add_dependency "rest-client"
|
21
|
+
s.add_dependency "rspec"
|
22
|
+
s.add_dependency "rspec-collection_matchers", "~> 1.0.x"
|
22
23
|
s.require_paths = ["lib"]
|
23
24
|
end
|
@@ -1,20 +1,16 @@
|
|
1
1
|
require 'html5_validator/matchers'
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
3
|
describe Html5Validator::Validator do
|
5
|
-
|
6
|
-
|
7
|
-
end
|
4
|
+
let(:invalid_html) { File.open('spec/fixtures/invalid_html.html').read }
|
5
|
+
let(:valid_html) { File.open('spec/fixtures/valid_html.html').read }
|
8
6
|
|
9
7
|
describe "when using the custom matcher" do
|
10
8
|
it "should not be valid html5 when supplied with invalid content" do
|
11
|
-
|
12
|
-
@html.should_not be_valid_html5
|
9
|
+
expect(invalid_html).not_to be_valid_html5
|
13
10
|
end
|
14
11
|
|
15
12
|
it "should be valid html5 when supplied with valid content" do
|
16
|
-
|
17
|
-
@html.should be_valid_html5
|
13
|
+
expect(valid_html).to be_valid_html5
|
18
14
|
end
|
19
15
|
end
|
20
16
|
|
@@ -25,11 +21,11 @@ describe Html5Validator::Validator do
|
|
25
21
|
end
|
26
22
|
|
27
23
|
it "should not be valid html5" do
|
28
|
-
subject.valid
|
24
|
+
expect(subject.valid?).to be false
|
29
25
|
end
|
30
26
|
|
31
27
|
it "should return at least 1 error" do
|
32
|
-
subject.
|
28
|
+
expect(subject).to have_at_least(1).errors
|
33
29
|
end
|
34
30
|
end
|
35
31
|
|
@@ -39,11 +35,11 @@ describe Html5Validator::Validator do
|
|
39
35
|
end
|
40
36
|
|
41
37
|
it "should be valid html5" do
|
42
|
-
subject.valid
|
38
|
+
expect(subject.valid?).to be true
|
43
39
|
end
|
44
40
|
|
45
41
|
it "should return zero errors" do
|
46
|
-
subject.
|
42
|
+
expect(subject).to have(0).errors
|
47
43
|
end
|
48
44
|
end
|
49
45
|
end
|
@@ -51,35 +47,33 @@ describe Html5Validator::Validator do
|
|
51
47
|
context "validating text" do
|
52
48
|
describe "when supplied with invalid html" do
|
53
49
|
before do
|
54
|
-
|
55
|
-
subject.validate_text(@html)
|
50
|
+
subject.validate_text(invalid_html)
|
56
51
|
end
|
57
52
|
|
58
53
|
it "should not be valid html5" do
|
59
|
-
subject.valid
|
54
|
+
expect(subject.valid?).to be false
|
60
55
|
end
|
61
56
|
|
62
57
|
it "should return two errors" do
|
63
|
-
subject.
|
58
|
+
expect(subject).to have(2).errors
|
64
59
|
end
|
65
60
|
|
66
61
|
it "should include an error complaining about the lack of a closing section tag" do
|
67
|
-
subject.inspect.
|
62
|
+
expect(subject.inspect).to include('Unclosed element')
|
68
63
|
end
|
69
64
|
end
|
70
65
|
|
71
66
|
describe "when supplied with valid html" do
|
72
67
|
before do
|
73
|
-
|
74
|
-
subject.validate_text(@html)
|
68
|
+
subject.validate_text(valid_html)
|
75
69
|
end
|
76
70
|
|
77
71
|
it "should be valid html5" do
|
78
|
-
subject.valid
|
72
|
+
expect(subject.valid?).to be true
|
79
73
|
end
|
80
74
|
|
81
75
|
it "should return no errors" do
|
82
|
-
subject.
|
76
|
+
expect(subject).to have(0).errors
|
83
77
|
end
|
84
78
|
end
|
85
79
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,82 @@
|
|
1
|
+
require 'rspec/collection_matchers'
|
2
|
+
|
3
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
4
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
5
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
6
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
7
|
+
#
|
8
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
9
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
10
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
11
|
+
# individual file that may not need all of that loaded. Instead, make a
|
12
|
+
# separate helper file that requires this one and then use it only in the specs
|
13
|
+
# that actually need it.
|
14
|
+
#
|
15
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
16
|
+
# users commonly want.
|
17
|
+
#
|
18
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
1
19
|
RSpec.configure do |config|
|
2
|
-
config.
|
20
|
+
config.order = :random
|
21
|
+
|
22
|
+
# The settings below are suggested to provide a good initial experience
|
23
|
+
# with RSpec, but feel free to customize to your heart's content.
|
24
|
+
=begin
|
25
|
+
# These two settings work together to allow you to limit a spec run
|
26
|
+
# to individual examples or groups you care about by tagging them with
|
27
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
28
|
+
# get run.
|
29
|
+
config.filter_run :focus
|
3
30
|
config.run_all_when_everything_filtered = true
|
4
|
-
|
31
|
+
|
32
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
33
|
+
# file, and it's useful to allow more verbose output when running an
|
34
|
+
# individual spec file.
|
35
|
+
if config.files_to_run.one?
|
36
|
+
# Use the documentation formatter for detailed output,
|
37
|
+
# unless a formatter has already been configured
|
38
|
+
# (e.g. via a command-line flag).
|
39
|
+
config.default_formatter = 'doc'
|
40
|
+
end
|
41
|
+
|
42
|
+
# Print the 10 slowest examples and example groups at the
|
43
|
+
# end of the spec run, to help surface which specs are running
|
44
|
+
# particularly slow.
|
45
|
+
config.profile_examples = 10
|
46
|
+
|
47
|
+
# Run specs in random order to surface order dependencies. If you find an
|
48
|
+
# order dependency and want to debug it, you can fix the order by providing
|
49
|
+
# the seed, which is printed after each run.
|
50
|
+
# --seed 1234
|
51
|
+
config.order = :random
|
52
|
+
|
53
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
54
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
55
|
+
# test failures related to randomization by passing the same `--seed` value
|
56
|
+
# as the one that triggered the failure.
|
57
|
+
Kernel.srand config.seed
|
58
|
+
|
59
|
+
# rspec-expectations config goes here. You can use an alternate
|
60
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
61
|
+
# assertions if you prefer.
|
62
|
+
config.expect_with :rspec do |expectations|
|
63
|
+
# Enable only the newer, non-monkey-patching expect syntax.
|
64
|
+
# For more details, see:
|
65
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
66
|
+
expectations.syntax = :expect
|
67
|
+
end
|
68
|
+
|
69
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
70
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
71
|
+
config.mock_with :rspec do |mocks|
|
72
|
+
# Enable only the newer, non-monkey-patching expect syntax.
|
73
|
+
# For more details, see:
|
74
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
75
|
+
mocks.syntax = :expect
|
76
|
+
|
77
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
78
|
+
# a real object. This is generally recommended.
|
79
|
+
mocks.verify_partial_doubles = true
|
80
|
+
end
|
81
|
+
=end
|
5
82
|
end
|
metadata
CHANGED
@@ -1,57 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: html5_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damian Nicholson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
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
|
-
version:
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rest-client
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec-collection_matchers
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.0.x
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.0.x
|
55
69
|
description: Ruby gem to test for valid HTML5 markup with RSpec
|
56
70
|
email:
|
57
71
|
- damian.nicholson21@gmail.com
|
@@ -59,7 +73,8 @@ executables: []
|
|
59
73
|
extensions: []
|
60
74
|
extra_rdoc_files: []
|
61
75
|
files:
|
62
|
-
- .gitignore
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
63
78
|
- Gemfile
|
64
79
|
- README.rdoc
|
65
80
|
- Rakefile
|
@@ -81,17 +96,17 @@ require_paths:
|
|
81
96
|
- lib
|
82
97
|
required_ruby_version: !ruby/object:Gem::Requirement
|
83
98
|
requirements:
|
84
|
-
- -
|
99
|
+
- - ">="
|
85
100
|
- !ruby/object:Gem::Version
|
86
101
|
version: '0'
|
87
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
103
|
requirements:
|
89
|
-
- -
|
104
|
+
- - ">="
|
90
105
|
- !ruby/object:Gem::Version
|
91
106
|
version: '0'
|
92
107
|
requirements: []
|
93
108
|
rubyforge_project: html5_validator
|
94
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.2.2
|
95
110
|
signing_key:
|
96
111
|
specification_version: 4
|
97
112
|
summary: Ruby gem to test for valid HTML5 markup with RSpec
|
@@ -100,4 +115,3 @@ test_files:
|
|
100
115
|
- spec/fixtures/valid_html.html
|
101
116
|
- spec/html5_validator_spec.rb
|
102
117
|
- spec/spec_helper.rb
|
103
|
-
has_rdoc:
|