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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGU1ZDhiODZiYzRhNzQ3NzI5YjExYjg4NjNmNTZjZjYzNjZmZDA0Mw==
4
+ NzllM2IyMmY4MGQ0Y2MyNzk4NjUwZjEyMDNjNjViZDhmNGNkYTM4ZQ==
5
5
  data.tar.gz: !binary |-
6
- NTgzZjE1YWE3ZmIzM2VkMGM0MDBjNzY1MmY1NjBiODc1YTI0ZWExNA==
6
+ YTAxODEzMDk5OTcxYjA5ZWUwZTc2OTgwZDc4MzE3YjMxNWU0YzIzZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OWI0NzlhMjkxNzM2YWNiMjk2NjAxZTBhYTFlZjkwMjhlMTM3ZTBhNGIxMjUz
10
- OTVkMzBhYjQxOTA1OTljMWQxYjQwNGNhNWNjMmJiYWViM2RmYzRjNjczMzQx
11
- MmRkOWYyYWE0NTYwZmJlMjVlNjA4NWVmMWEwMWY2ZDdlZTFhMzk=
9
+ YjZhNGU2NWY3M2ViM2Y0YzIyNTdjYmI1YmYxNDdkOTA3YWUwMWRlMTcwNzc3
10
+ NjE4YmQ3YTUwN2Y4ZmZlZmI0NjNlNjdiZmU4NWZiNmFmMDNlNGU2MTk0MGM5
11
+ MWVkMjI5NzI1NWE1ZDM1NGFhY2I4NDNmNmM5MTcxMjEzMWJjNzA=
12
12
  data.tar.gz: !binary |-
13
- ZTcxMmQ4Y2ZkOWU1YTE2MjcwNjcxNWFmMjYzMjc2N2FlY2YxYjY2OGYxYmQ1
14
- YmEwYTFhMWJlZDdhZDUyOTk5NWQ5NDkxMTk3Nzg1NzU2NDM2YzdkYzlhY2Yz
15
- ZGRiOGRjYzI3MTk2YjgyYjMzZDk1MWMwM2RmMjk1NDU4MjAzZjE=
13
+ NmViNDIwZGJmZTJkY2UyNjdjN2M2NzM4MDMyOGRlMTdiNjFmM2JhNDQ3N2Uw
14
+ NTlmMTZhZmFmYTIyNjUyZDgwNWYxOTA1NzQ0MTc4YWUxNDI3ZmM1MTMyMmIz
15
+ M2NjYjRmY2NlM2UyMWQ4MmYzNjgwMTAyMjFhMTk1NjUzYmU0MGI=
data/CHANGES CHANGED
@@ -283,4 +283,8 @@
283
283
 
284
284
  == Version 1.9.12
285
285
 
286
- * Exclude capybara-webkit for windows
286
+ * Exclude capybara-webkit for windows
287
+
288
+ == Version 1.9.13
289
+
290
+ * Add method to dynamically detect pages
@@ -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
@@ -1,3 +1,3 @@
1
1
  class AcceptanceTest
2
- VERSION = "1.9.12"
2
+ VERSION = "1.9.13"
3
3
  end
@@ -14,7 +14,7 @@ class WikipediaPages < PageSet
14
14
 
15
15
  @main_page = MainPage.new self
16
16
 
17
- delegate_to_pages :main_page
17
+ delegate_to :main_page
18
18
  end
19
19
 
20
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acceptance_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.12
4
+ version: 1.9.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Shvets