rspec_website_helpers 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -31
- data/lib/rspec_website_helpers/collect_pages.rb +5 -2
- data/lib/rspec_website_helpers/matchers.rb +1 -1
- data/lib/rspec_website_helpers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee11b33231f2d827bc56f68425f0b08b1835a548
|
4
|
+
data.tar.gz: ce7d7a06f5361b20be7e71f4a76245d1239f5244
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c431b60cf4dce470c6c1bc575aad18f50f1d8e91b714e76fca1fdfc1ea64c837c3e92201ada4165fd0ddacb06921770bc171c213de33cba80d8b6d4e005f57f8
|
7
|
+
data.tar.gz: 855bad05206bc4eadd58ccc4f095525ac4072759abdeea9e8a7e61c4d8a7ac96eef1b79c49d886ba0ba320be6cf73b366986854bcd3381f22c4e14714e825a2f
|
data/README.md
CHANGED
@@ -1,36 +1,12 @@
|
|
1
1
|
# RspecWebsiteHelpers
|
2
2
|
|
3
|
-
|
3
|
+
A set of rspec helpers to test the websites with the following aspects:
|
4
|
+
* spelling,
|
5
|
+
* existence of the targets of internal links,
|
6
|
+
* existence of fragments in the html targets of internal links, and
|
7
|
+
* existence of external href targets.
|
4
8
|
|
5
|
-
|
9
|
+
See the [Cider-CI Documentation Source][] project for an example how this library can be used.
|
6
10
|
|
7
|
-
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'rspec_website_helpers'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install rspec_website_helpers
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
|
-
## Contributing
|
34
|
-
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rspec_website_helpers.
|
11
|
+
[Cider-CI Documentation Source]: https://github.com/cider-ci/cider-ci_documentation-source
|
36
12
|
|
@@ -27,12 +27,15 @@ def collect_targets url, context = url
|
|
27
27
|
|
28
28
|
|
29
29
|
local_targets = all("a").map{|a| a[:href]} \
|
30
|
-
.map{|href| Addressable::URI.parse(href)} \
|
30
|
+
.map{|href| Addressable::URI.parse(href) rescue nil} \
|
31
|
+
.compact \
|
31
32
|
.map{|t| current_uri + t } \
|
32
33
|
.map(&:normalize)
|
33
34
|
|
34
35
|
local_targets.each do |target|
|
35
|
-
if (Capybara.app_host == target.site)
|
36
|
+
if (Capybara.app_host == target.site) \
|
37
|
+
and (target.path.starts_with? context) \
|
38
|
+
and (/xml$/ !~ target.path)
|
36
39
|
unless @internal_pages [target.path]
|
37
40
|
initialize_path target.path
|
38
41
|
collect_targets target, context
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_website_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Schank
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|