generic_test 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -1
- data/ChangeLog +4 -0
- data/exe/generic_test +3 -7
- data/lib/generic_test/version.rb +1 -1
- data/spec/generic_test_spec.rb +19 -21
- data/spec/spec_helper.rb +0 -2
- data/spec/test_gem_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db48df4cfd4cd3d8c19c7678a1c6055ce2d445ab6b9537762ee7376e96abe639
|
4
|
+
data.tar.gz: 1085e7d52b22cdd9df1b979118645bff5454bf30038335182ac20d071dccd7b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6a91b9bde9af86eb671a9441da34f0f64bd4b3b958754f01fc77096d3906093bffb30f5500dc8b1289b9c857d219e5f538f8d1d8e6024064ddd202a72cb22c2
|
7
|
+
data.tar.gz: dfeeec46979ed84bb0e0c5fa8925daf6951016cc7755dafc12544b71c298e252d509e259063ec4fd8ee2bd4fc59192532aca8d337bfbe989bb8d5108657bacdb
|
data/.rspec
CHANGED
data/ChangeLog
CHANGED
data/exe/generic_test
CHANGED
@@ -3,22 +3,18 @@
|
|
3
3
|
|
4
4
|
require 'thor'
|
5
5
|
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
6
|
-
require 'generic_test'
|
7
6
|
|
8
7
|
# Executable for Generic Test
|
9
8
|
class Exe < Thor
|
10
9
|
desc 'page page_url', 'Test web page'
|
11
10
|
def page(page_url)
|
12
11
|
ENV['PAGE_URL'] = page_url
|
13
|
-
puts File.join(File.dirname(__FILE__))
|
14
12
|
test_file_path = File.join(File.dirname(__FILE__), '..', 'spec', 'generic_test_spec.rb')
|
15
13
|
raise "no file at #{test_file_path}" unless File.exist? test_file_path
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
system command # "rspec #{test_file_path} --format documentation --require generic_test"
|
21
|
-
#puts `rspec #{test_file_path} --format documentation --require generic_test`
|
15
|
+
desc = ENV['PAGE_URL'].split('://').last
|
16
|
+
command = "rspec #{test_file_path} --format documentation --require generic_test/setup --color --format RspecJunitFormatter --out logs/page_#{desc}.xml"
|
17
|
+
system command
|
22
18
|
end
|
23
19
|
end
|
24
20
|
|
data/lib/generic_test/version.rb
CHANGED
data/spec/generic_test_spec.rb
CHANGED
@@ -1,29 +1,27 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
GenericTest.pages.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
next unless link.href && !link.href.empty?
|
3
|
+
page = GenericTest.pages.first
|
4
|
+
links = page.links
|
5
|
+
RSpec.describe "#{page.title} Links respond" do
|
6
|
+
links.each_with_index do |link, index|
|
7
|
+
next unless link.href && !link.href.empty?
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
end
|
9
|
+
it "Link (#{index + 1}) \"#{link.text}\" to '#{link.href}' responds" do
|
10
|
+
expect(Checker.link_status(link.href)).to be_between 200, 399
|
13
11
|
end
|
14
12
|
end
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
13
|
+
end
|
14
|
+
RSpec.describe "#{page.title} Page content" do
|
15
|
+
spellcheck_report = SpellCheck::ProofReader.check(page.html)
|
16
|
+
context 'does not have common spelling mistakes' do
|
17
|
+
it 'has no mistakes' do
|
18
|
+
expect(spellcheck_report.status).to eq 'Accept'
|
19
|
+
end
|
20
|
+
spellcheck_report.errata.group_by(&:line_number).each do |line_number, mistakes|
|
21
|
+
context "Line #{line_number}" do
|
22
|
+
mistakes.each_with_index do |mistake, index|
|
23
|
+
it "(#{index + 1}) #{mistake.pattern}" do
|
24
|
+
expect(mistake.pattern).to eq mistake.expected
|
27
25
|
end
|
28
26
|
end
|
29
27
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/test_gem_spec.rb
CHANGED