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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f82f1516be5db094e3e8ba76fc96c0005a7cd248
4
- data.tar.gz: 4ac8ff2be8e31885eacec3150603ca870157a7eb
3
+ metadata.gz: ee11b33231f2d827bc56f68425f0b08b1835a548
4
+ data.tar.gz: ce7d7a06f5361b20be7e71f4a76245d1239f5244
5
5
  SHA512:
6
- metadata.gz: 22b53d94a6b77d041b510868ab8c983aa01603c69ce99f94c1dd29929b81e2458541ab7330174ac67c453d9d1bf7e689ace722c26eda60cc5a2faf2b7f92af75
7
- data.tar.gz: 242925b7a7495493000d4d5b0ebb332860b6d4868088bf1a3ae307e12e4f0600826b7fd3c06c433e3c3212d39b8a89f199baba239fd8512235900428852782f3
6
+ metadata.gz: c431b60cf4dce470c6c1bc575aad18f50f1d8e91b714e76fca1fdfc1ea64c837c3e92201ada4165fd0ddacb06921770bc171c213de33cba80d8b6d4e005f57f8
7
+ data.tar.gz: 855bad05206bc4eadd58ccc4f095525ac4072759abdeea9e8a7e61c4d8a7ac96eef1b79c49d886ba0ba320be6cf73b366986854bcd3381f22c4e14714e825a2f
data/README.md CHANGED
@@ -1,36 +1,12 @@
1
1
  # RspecWebsiteHelpers
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rspec_website_helpers`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Delete this and the text above, and describe your gem
9
+ See the [Cider-CI Documentation Source][] project for an example how this library can be used.
6
10
 
7
- ## Installation
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) and (target.path.starts_with? context)
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
@@ -66,7 +66,7 @@ end
66
66
 
67
67
  RSpec::Matchers.define :be_an_existing_uri do
68
68
  match do |uri|
69
- unless uri.site =~ /localhost/
69
+ if uri.scheme =~ /^http/
70
70
  $logger.info "GET check #{uri}"
71
71
  @resp= Faraday.new(ssl: {verify: false}).get(uri)
72
72
  (200..399).include? @resp.status
@@ -1,3 +1,3 @@
1
1
  module RspecWebsiteHelpers
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
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.0
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-29 00:00:00.000000000 Z
11
+ date: 2015-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler