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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a32c398102e166f203ca9deac04e804633743251570326ff0c3cf532ebd8320
4
- data.tar.gz: 190570281ceb883cf04f41f4039da024e7105ac0db2293a64ed752f367771148
3
+ metadata.gz: db48df4cfd4cd3d8c19c7678a1c6055ce2d445ab6b9537762ee7376e96abe639
4
+ data.tar.gz: 1085e7d52b22cdd9df1b979118645bff5454bf30038335182ac20d071dccd7b9
5
5
  SHA512:
6
- metadata.gz: b60f785051b3c2985a6c44f0f41ae408a3ae18c1a58383ffd372926b7be25b44122e7b9d8c319a40eaaf5d260aba2d50883c8028a39a62453ee0911a7cc19d8f
7
- data.tar.gz: ba4ca97e2fa95763544d8b3fa71851535c7cabab48feb384ee3da843ea3cf1d5cac6550a65995644073496ad07520d258977aee1e67387f20427025712f2042a
6
+ metadata.gz: f6a91b9bde9af86eb671a9441da34f0f64bd4b3b958754f01fc77096d3906093bffb30f5500dc8b1289b9c857d219e5f538f8d1d8e6024064ddd202a72cb22c2
7
+ data.tar.gz: dfeeec46979ed84bb0e0c5fa8925daf6951016cc7755dafc12544b71c298e252d509e259063ec4fd8ee2bd4fc59192532aca8d337bfbe989bb8d5108657bacdb
data/.rspec CHANGED
@@ -1,4 +1,4 @@
1
1
  --format documentation
2
2
  --color
3
3
  --require spec_helper
4
- --format RspecJunitFormatter --out logs/rspec_page_<%= ENV['PAGE_NUM'] %>.xml
4
+ --format RspecJunitFormatter --out logs/page_<%= ENV['PAGE_URL'].split('://').last %>.xml
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Version 0.1.5
2
+ * Enhancement
3
+ * Add Junit formatter
4
+
1
5
  Version 0.1.4
2
6
  * Bug fix
3
7
  * Fix path
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
- command = "rspec #{test_file_path} --format documentation --require generic_test/setup"
18
- puts command
19
- #require_relative '../lib/generic_test/setup'
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GenericTest
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
@@ -1,29 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- GenericTest.pages.each do |page|
4
- links = page.links
5
- RSpec.describe 'Links respond' do
6
- puts "Found #{links} links"
7
- links.each_with_index do |link, index|
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
- it "Link (#{index + 1}) \"#{link.text}\" to '#{link.href}' responds" do
11
- expect(Checker.link_status(link.href)).to be_between 200, 399
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
- RSpec.describe 'Page content' do
16
- spellcheck_report = SpellCheck::ProofReader.check(page.html)
17
- context 'does not have common spelling mistakes' do
18
- it 'has no mistakes' do
19
- expect(spellcheck_report.status).to eq 'Accept'
20
- end
21
- spellcheck_report.errata.group_by(&:line_number).each do |line_number, mistakes|
22
- context "Line #{line_number}" do
23
- mistakes.each_with_index do |mistake, index|
24
- it "(#{index + 1}) #{mistake.pattern}" do
25
- expect(mistake.pattern).to eq mistake.expected
26
- end
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
@@ -3,8 +3,6 @@
3
3
  require 'bundler/setup'
4
4
  require 'generic_test/setup'
5
5
 
6
- #GenericTest.setup
7
-
8
6
  RSpec.configure do |config|
9
7
  # Close test server after all RSpec tests have run
10
8
  config.after(:suite) do
@@ -2,7 +2,7 @@
2
2
 
3
3
  GenericTest.pages.each do |page|
4
4
  links = page.links
5
- RSpec.describe "Checking broken links at #{page.url}" do
5
+ RSpec.describe 'Links respond' do
6
6
  it 'successful link passes' do
7
7
  expect(Checker.link_status(links[0].href)).to be_between 200, 399
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: generic_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Garratt