acceptance_test 1.9.12 → 1.9.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGES +5 -1
- data/lib/acceptance_test/page_set.rb +24 -0
- data/lib/acceptance_test/version.rb +1 -1
- data/spec/support/pages/wikipedia_pages.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzllM2IyMmY4MGQ0Y2MyNzk4NjUwZjEyMDNjNjViZDhmNGNkYTM4ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTAxODEzMDk5OTcxYjA5ZWUwZTc2OTgwZDc4MzE3YjMxNWU0YzIzZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjZhNGU2NWY3M2ViM2Y0YzIyNTdjYmI1YmYxNDdkOTA3YWUwMWRlMTcwNzc3
|
10
|
+
NjE4YmQ3YTUwN2Y4ZmZlZmI0NjNlNjdiZmU4NWZiNmFmMDNlNGU2MTk0MGM5
|
11
|
+
MWVkMjI5NzI1NWE1ZDM1NGFhY2I4NDNmNmM5MTcxMjEzMWJjNzA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmViNDIwZGJmZTJkY2UyNjdjN2M2NzM4MDMyOGRlMTdiNjFmM2JhNDQ3N2Uw
|
14
|
+
NTlmMTZhZmFmYTIyNjUyZDgwNWYxOTA1NzQ0MTc4YWUxNDI3ZmM1MTMyMmIz
|
15
|
+
M2NjYjRmY2NlM2UyMWQ4MmYzNjgwMTAyMjFhMTk1NjUzYmU0MGI=
|
data/CHANGES
CHANGED
@@ -75,10 +75,34 @@ class PageSet
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
+
def detect_pages scope
|
79
|
+
pages_classes = scope.constants.select do |class_name|
|
80
|
+
clazz = scope.const_get(class_name)
|
81
|
+
|
82
|
+
clazz.ancestors.include? Page
|
83
|
+
end
|
84
|
+
|
85
|
+
pages_classes.collect do |class_name|
|
86
|
+
clazz = scope.const_get(class_name)
|
87
|
+
|
88
|
+
object = clazz.new self
|
89
|
+
|
90
|
+
name = underscore(class_name.to_s)
|
91
|
+
|
92
|
+
self.instance_variable_set("@#{name}", object)
|
93
|
+
|
94
|
+
name
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
78
98
|
private
|
79
99
|
|
80
100
|
def camelize string
|
81
101
|
string.split("_").each {|s| s.capitalize! }.join("")
|
82
102
|
end
|
83
103
|
|
104
|
+
def underscore string
|
105
|
+
string.scan(/[A-Z][a-z]*/).join("_").downcase
|
106
|
+
end
|
107
|
+
|
84
108
|
end
|