site_prism-all_there 0.2.1 → 0.3

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: 98959a1d3f689e5d849760ef9a7960ef696cac8cb8e19c52cfc56da862eabf3d
4
- data.tar.gz: 331306ed4ffa6f70922d21da78b1cdbe18b25da839d8fce1afb796d9db0c92d9
3
+ metadata.gz: ec87af6636d37a39b333043f8f5e8be8f2063c968f22abef7e996d95d13d8f0c
4
+ data.tar.gz: 5e0c1cc43d5b4f3ab2e0bda50fe969d0213e5aaad0f4a0d97513275f1940e5b1
5
5
  SHA512:
6
- metadata.gz: 9e37113f2844e37e68dc9e4f5e5d3c9324cd4b46f9341a001a70dbfe9ea0cdb538b0700201eabba77265b3ec822ab1774bc3ea2225823cd7170ede0e3c8ea34f
7
- data.tar.gz: 8e4ae6832dc3cd2d09d65fbb0af6f13089b65c33286f4c2b3f509b7a4764910cfd58330b09d7385971614516711b970cc81035d14eff8e092737ccee99748c90
6
+ metadata.gz: '096fda4229852de2bda80d8fd3bddeb6e2c7718c5b82e08e87389719fba151bf4c345235af58afba0ca32db7c2ec8598806c7227b606c69c2b8b34047119aca4'
7
+ data.tar.gz: edfc6310c97177d776de1dc8ca47136c6a182e2efb0c9e90c77cac3552cf8f167c01e891b4cbbd28a487c13173f7320d529de1f70f34755fc7aaf7395c14e4d6
data/README.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # site_prism-all_there
2
+
2
3
  The breakout gem from SitePrism to perform recursion checks for `#all_there?`
3
4
 
4
- This gem is currently being developed by copying over the code-base from the existing
5
- SitePrism repo and slowly refactoring it and breaking it out
5
+ This gem is a breakout of the current `SitePrism::Page#all_there?` and `SitePrism::Section#all_there?`
6
+ methods which already exist.
6
7
 
7
- As such at the moment, the gem is very much considered a Work in Progress and works "as is".
8
+ At the moment, the gem is very much considered a Work in Progress and works "as is". It is
9
+ currently released as a `0.x` version meaning it is not fully API stable.
8
10
 
9
- It is fully expected to have a number of bug-fix / refactor PR's in between each minor release.
11
+ ## Usage
10
12
 
11
13
  Add the following code to either `spec_helper.rb` or `env.rb`
12
14
 
@@ -24,6 +24,26 @@ module SitePrism
24
24
  ]
25
25
  end
26
26
 
27
+ def element
28
+ mapped_checklist_of(:element)
29
+ end
30
+
31
+ def elements
32
+ mapped_checklist_of(:elements)
33
+ end
34
+
35
+ def section
36
+ mapped_checklist_of(:section)
37
+ end
38
+
39
+ def sections
40
+ mapped_checklist_of(:sections)
41
+ end
42
+
43
+ def iframe
44
+ mapped_checklist_of(:iframe)
45
+ end
46
+
27
47
  private
28
48
 
29
49
  def mapped_checklist_of(type)
@@ -30,7 +30,7 @@ module SitePrism
30
30
  # This will check all elements that are in the current scope
31
31
  # This is equivalent to checking with a recursion value of +:none+
32
32
  def current_class_all_there?
33
- expected_item_map.flatten.all? { |name| there?(name) }
33
+ expected_items.array.flatten.all? { |name| there?(name) }
34
34
  end
35
35
 
36
36
  # This will check all elements that are in any of the individual
@@ -46,15 +46,15 @@ module SitePrism
46
46
  end
47
47
 
48
48
  def section_classes_to_check
49
- expected_item_map[2].map { |name| instance.send(name) }
49
+ expected_items.section.map { |name| instance.send(name) }
50
50
  end
51
51
 
52
52
  def sections_classes_to_check
53
- expected_item_map[3].map { |name| instance.send(name) }
53
+ expected_items.sections.map { |name| instance.send(name) }
54
54
  end
55
55
 
56
- def expected_item_map
57
- ExpectedItems.new(instance).array
56
+ def expected_items
57
+ @expected_items ||= ExpectedItems.new(instance)
58
58
  end
59
59
 
60
60
  def there?(name)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SitePrism
4
4
  module AllThere
5
- VERSION = '0.2.1'
5
+ VERSION = '0.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: site_prism-all_there
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Hill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-01 00:00:00.000000000 Z
11
+ date: 2019-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -44,28 +44,42 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.71.0
47
+ version: 0.73.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.71.0
54
+ version: 0.73.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubocop-performance
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.0.0
61
+ version: '1.4'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.0.0
68
+ version: '1.4'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.33'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.33'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: site_prism
71
85
  requirement: !ruby/object:Gem::Requirement