lazy-check 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01b26c8325189a7f9eb1fd7267c017fb85462466363d698dc85925292ff77204
4
- data.tar.gz: c4e0094b36134478cbed092b1a94d00fc7ec89e9439e452ef958c908680e27da
3
+ metadata.gz: b94eebd33ad3e7cab31da966d0f1e6a9c4a715eead6612c9efa0f6927057acfb
4
+ data.tar.gz: 5046da76393bd82b079de203f1577863e3fc8f44231c72fdeed9fb4abf743dcd
5
5
  SHA512:
6
- metadata.gz: 0c5e860db28567e05f96909b080a723e8a7b2c047ad72e53a01f46126db543557beb492f02283b4e17d9328a3790d6e4546e1b81cc502090d5971ca4046dd429
7
- data.tar.gz: 13e3bb1d81c208c74702f47df3dbcf37b1f0be82b474311e8456c486dc97673fe2f0cc6be676a95b4899d6f0ba73eb0fef16c2cd1c9accd93ed4cd17ca4ad897
6
+ metadata.gz: 83070a11c3f28ae67e42a3986e8c1ca63afebdf61483dadff04530549133b25880954e57eeb69afd959bcd6567faba5a0a7ec5758575cf804df8a6edbefc9aac
7
+ data.tar.gz: 6a4bd743a066600783021768e5f83b3162d6c1a55e0b7cabd64fac2f8a0eabb04887dcc75edae70c33cbfc254f61146c8d242eb7dce8c25da71b45fa4e91c060
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lazy-check (0.1.0)
4
+ lazy-check (1.2.1)
5
5
  clir
6
6
  nokogiri
7
7
 
data/README-fr.md CHANGED
@@ -37,7 +37,7 @@ Lazy::Checker.check(code, check)
37
37
  # Succès 1 Failure 0 Temps ...
38
38
  ~~~
39
39
 
40
- On peut aussi obtenir les résultats en retour de méthode (c'est un `Lazy::Checker::Reporter`)
40
+ On peut aussi obtenir les résultats en retour de méthode (c'est un `Lazy::Checker::Reporter`).
41
41
 
42
42
  ~~~ruby
43
43
  Lazy::Checker.check(code, check, **{return_result: true})
@@ -51,7 +51,7 @@ Lazy::Checker.check(code, check, **{return_result: true})
51
51
  Une « recette » est un fichier `YAML` qui définit l'url d'une page internet, ainsi que les checks à effectuer dessus. Cf. ci-dessous.
52
52
 
53
53
  ~~~ruby
54
- require "lazy-check"
54
+ require "lazy/check"
55
55
 
56
56
  checker = Lazy::Checker.new("path/to/recipe.yaml")
57
57
  checker.check
@@ -61,7 +61,7 @@ checker.check
61
61
  Si la recette se trouve là où le terminal se trouve, il suffit de faire :
62
62
 
63
63
  ~~~ruby
64
- require "lazy-check"
64
+ require "lazy/check"
65
65
 
66
66
  Lazy::Checker.new.check
67
67
  ~~~
@@ -83,21 +83,23 @@ tests:
83
83
  tag: 'span#range'
84
84
  empty: true
85
85
 
86
- - name: "Une redirection"
87
- url: "redirection.html"
88
- redirect_to: "https://nouvelle.url.net"
86
+ - name: "Une redirection"
87
+ url: "redirection.html"
88
+ redirect_to: "https://nouvelle.url.net"
89
89
 
90
- - name: "Une page erronée"
91
- url: "page_inexistante.html"
92
- response: 404
90
+ - name: "Une page erronée"
91
+ url: "page_inexistante.html"
92
+ response: 404
93
93
  ~~~
94
94
 
95
95
  ### Check Properties
96
96
 
97
+ Les "checks" ci-dessus peuvent définir les propriétés suivantes :
98
+
97
99
  ~~~yaml
98
100
  tag: [String] Le sélector
99
101
  count: [Integer] Nombre attendu d'éléments
100
- empty: [Bool] Si true, doit être vide ou non vide
102
+ empty: [Bool] Si true, doit être vide, si false, non vide
101
103
  direct_child: [Bool] Si true, doit être un enfant direct
102
104
  text: [String] Le texte qui doit être contenu
103
105
  contains: [String|Array] Ce que doit contenir la page
@@ -120,7 +122,7 @@ tests:
120
122
  response: 200
121
123
  ~~~
122
124
 
123
- Vérifier qu’une page contient les éléments de base
125
+ Vérifier qu’une page contient les éléments de base :
124
126
 
125
127
  ~~~yaml
126
128
  # recipe.yaml
@@ -128,7 +130,7 @@ Vérifier qu’une page contient les éléments de base
128
130
  name: "Check simple de l'existence des éléments de base"
129
131
  base: 'https://monsite.net'
130
132
  tests:
131
- - name: "La page base.html contient les éléments de base"
133
+ - name: "La page index.html contient les éléments de base"
132
134
  url: 'index.html'
133
135
  checks:
134
136
  - tag: 'header'
@@ -136,7 +138,13 @@ tests:
136
138
  - tag: 'footer'
137
139
  ~~~
138
140
 
141
+ ## Tester le gem
142
+
143
+ Lancer les tests avec :
139
144
 
145
+ ~~~
146
+ rake test
147
+ ~~~
140
148
 
141
149
  ## Development
142
150
 
data/README.md CHANGED
@@ -37,98 +37,100 @@ Lazy::Checker.check(code, check)
37
37
  # Success 1 Failures 0 Duration ...
38
38
  ~~~
39
39
 
40
- On peut aussi obtenir les résultats en retour de méthode (c'est un `Lazy::Checker::Reporter`)
40
+ You can also obtain the results in method return (this is a `Lazy::Checker::Reporter`).
41
41
 
42
42
  ~~~ruby
43
43
  Lazy::Checker.check(code, check, **{return_result: true})
44
44
  # => Reporter
45
45
  ~~~
46
46
 
47
- > Noter que dans ce cas-là, rien n'est écrit en console.
47
+ > Note that in this case, nothing is written in the console.
48
48
 
49
- ## Pour un test avec recette
49
+ ## For a test with a recipe
50
50
 
51
- Une « recette » est un fichier `YAML` qui définit l'url d'une page internet, ainsi que les checks à effectuer dessus. Cf. ci-dessous.
51
+ A "recipe" is a `YAML` file that defines the url of a web page, and the checks to be performed on it. See below.
52
52
 
53
53
  ~~~ruby
54
- require "lazy-check"
54
+ require "lazy/check"
55
55
 
56
56
  checker = Lazy::Checker.new("path/to/recipe.yaml")
57
57
  checker.check
58
- # => Produit le résultat
58
+ # => Produces the result
59
59
  ~~~
60
60
 
61
- Si la recette se trouve le terminal se trouve, il suffit de faire :
61
+ If the recipe is located where the terminal is, simply do:
62
62
 
63
63
  ~~~ruby
64
- require "lazy-check"
64
+ require "lazy/check"
65
65
 
66
66
  Lazy::Checker.new.check
67
67
  ~~~
68
68
 
69
- La recette (`recipe.yaml`) définit les vérifications qu'il faut effectuer.
69
+ The recipe (`recipe.yaml`) defines the checks to be performed.
70
70
 
71
71
  ~~~yaml
72
72
  ---
73
- name: "Nom général de la recette"
74
- base: https://www.mon.domaine.net
73
+ name: "Name for this recipe"
74
+ base: https://www.my.domain.net
75
75
  tests:
76
- - name: "Le premier test"
77
- url: "" # donc la base
76
+ - name: "My first test"
77
+ url: "" # so the base
78
78
  checks:
79
- - name: "Existence du DIV#content avec du texte"
79
+ - name: "Existence of DIV#content with text"
80
80
  tag: 'div#content'
81
81
  empty: false
82
- - name: "Existence du SPAN#range sans texte"
82
+ - name: "Existence of SPAN#range without text"
83
83
  tag: 'span#range'
84
84
  empty: true
85
85
 
86
- - name: "Une redirection"
87
- url: "redirection.html"
88
- redirect_to: "https://nouvelle.url.net"
86
+ - name: "A redirection"
87
+ url: "redirection.html"
88
+ redirect_to: "https://new.url.net"
89
89
 
90
- - name: "Une page erronée"
91
- url: "page_inexistante.html"
92
- response: 404
90
+ - name: "A wrong page"
91
+ url: "page_unfound.html"
92
+ response: 404
93
93
  ~~~
94
94
 
95
95
  ### Check Properties
96
96
 
97
+ The above "checks" can define the following properties:
98
+
97
99
  ~~~yaml
98
- tag: [String] Le sélector
99
- count: [Integer] Nombre attendu d'éléments
100
- empty: [Bool] Si true, doit être vide ou non vide
101
- direct_child: [Bool] Si true, doit être un enfant direct
102
- text: [String] Le texte qui doit être contenu
103
- contains: [String|Array] Ce que doit contenir la page
104
- min_length: [Integer] La longueur minimum du contenu (text seulement)
105
- max_length: [Integer] La longueur maximum du contenu (text seulement)
100
+ tag: [String] The selector
101
+ count: [Integer] Expected number of elements
102
+ empty: [Bool] If true, must be empty, if false, must be non-empty
103
+ direct_child: [Bool] If true, must be a direct child
104
+ text: [String] The text that must be contained
105
+ contains: [String|Array] What the page should contain
106
+ min_length: [Integer] Minimum content length (text only)
107
+ max_length: [Integer] Maximum content length (text only)
106
108
  ~~~
107
109
 
108
- ## Exemples
110
+ ## Examples
109
111
 
110
- Simplement vérifier qu’une page réponde correctement :
112
+ Simply check that a page responds correctly:
111
113
 
112
114
  ~~~yaml
113
115
  # recipe.yaml
114
116
  ---
115
- name: "La page existe"
116
- base: 'https://monsite.net'
117
+ name: "Page exists"
118
+ base: 'https://mywebsite.net'
117
119
  tests:
118
- - name: "La page index.html existe et répond correctement"
120
+ - name: "The index.html page exists and responds correctly"
119
121
  url: 'index.html'
120
122
  response: 200
121
123
  ~~~
122
124
 
123
- Vérifier qu’une page contient les éléments de base
125
+ Check that a page contains the basic elements.
124
126
 
125
127
  ~~~yaml
126
128
  # recipe.yaml
127
129
  ---
128
- name: "Check simple de l'existence des éléments de base"
129
- base: 'https://monsite.net'
130
+ name: "Simple check on the existence of basic elements"
131
+ base: 'https://mywebsite.net'
130
132
  tests:
131
- - name: "La page base.html contient les éléments de base"
133
+ - name: "The index.html page contains the basic elements"
132
134
  url: 'index.html'
133
135
  checks:
134
136
  - tag: 'header'
@@ -136,7 +138,13 @@ tests:
136
138
  - tag: 'footer'
137
139
  ~~~
138
140
 
141
+ ## Tests
142
+
143
+ Run the tests:
139
144
 
145
+ ~~~
146
+ rake test
147
+ ~~~
140
148
 
141
149
  ## Development
142
150
 
data/lazy-check.gemspec CHANGED
@@ -3,11 +3,11 @@ require_relative 'lib/lazy/check/version'
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "lazy-check"
5
5
  s.version = Lazy::Check::VERSION
6
- s.authors = ["PhilippePerret"]
6
+ s.authors = ["Philippe Perret"]
7
7
  s.email = ["philippe.perret@yahoo.fr"]
8
8
 
9
- s.summary = %q{Vérification paresseuse d'un site web}
10
- s.description = %q{Ce gem permet de façon paresseuse mais néanmoins sérieuse de tester qu'un site web est valide au niveau de ses pages et de son contenu.}
9
+ s.summary = %q{Check lazilly your web site pages}
10
+ s.description = %q{This gem is a lazy but serious way of testing that a website is valid in terms of its pages and content.}
11
11
  s.homepage = "https://rubygems.org/gems/lazy-check"
12
12
  s.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
13
13
 
@@ -1,5 +1,5 @@
1
1
  module Lazy
2
2
  module Check
3
- VERSION = "1.2.0"
3
+ VERSION = "1.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazy-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
- - PhilippePerret
7
+ - Philippe Perret
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
@@ -66,8 +66,8 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: Ce gem permet de façon paresseuse mais néanmoins sérieuse de tester qu'un
70
- site web est valide au niveau de ses pages et de son contenu.
69
+ description: This gem is a lazy but serious way of testing that a website is valid
70
+ in terms of its pages and content.
71
71
  email:
72
72
  - philippe.perret@yahoo.fr
73
73
  executables: []
@@ -128,5 +128,5 @@ requirements: []
128
128
  rubygems_version: 3.1.6
129
129
  signing_key:
130
130
  specification_version: 4
131
- summary: Vérification paresseuse d'un site web
131
+ summary: Check lazilly your web site pages
132
132
  test_files: []