testcentricity_web 1.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
  SHA1:
3
- metadata.gz: 2219b33acd3c154a1ab761cd6735edec4ab85cb7
4
- data.tar.gz: 386e29513ad6dc179e43be044fa046e948a5c76e
3
+ metadata.gz: 828ba7ccba0258caff9d05dbc66af20c6c87a915
4
+ data.tar.gz: 2a021784f3c899fdd34cebfcd490c6e44b911cfc
5
5
  SHA512:
6
- metadata.gz: 5ea2b77ec93411a8ede2b00152241964e51a083f0443730af7767acf6aa994e4ea1bd1e8b11ddd4057b6ae3d2d8c7b17ae18482fcfe35c1522ddf2b6f937ef99
7
- data.tar.gz: 9ea523e83de287bbbebe41c9f6ba0b9a0cb2f15684b6164431ab512be58a68698c3eb2e788c9d05f7d1246f7dfae424cf7c42e6de595fb00acdc7fa6f7ad8726
6
+ metadata.gz: 2ed47cdbaa73967009d8caf713d698ed17c541f569a4385416ba78d1a3a39992a1b1701b1ff814c0d2fe57a303390f207dd4b9acb8b46fdb6aa51a52070df33b
7
+ data.tar.gz: 3e30928f42b8a80a325f52b46e095cb34678183662f776cd8e27511227f80bb091f3e0da496c1e05e33fc8ee199c4b410a77740f98d39b0c4b936b92f2c705c7
@@ -36,15 +36,20 @@ module TestCentricity
36
36
 
37
37
  @page_objects = {}
38
38
 
39
- def self.register_page_object(page_ref, page_object)
40
- @page_objects[page_ref] = page_object unless @page_objects.has_key?(page_ref)
41
- page_key = page_object.page_name.gsub(/\s+/, "").downcase.to_sym
42
- if page_key != page_ref
43
- @page_objects[page_key] = page_object unless @page_objects.has_key?(page_key)
39
+ def self.register_page_objects(pages)
40
+ result = ''
41
+ pages.each do | page_object, page_class |
42
+ obj = page_class.new
43
+ @page_objects[page_object] = obj unless @page_objects.has_key?(page_object)
44
+ page_key = obj.page_name.gsub(/\s+/, "").downcase.to_sym
45
+ if page_key != page_object
46
+ @page_objects[page_key] = obj unless @page_objects.has_key?(page_key)
47
+ end
48
+ result = "#{result}def #{page_object.to_s};@#{page_object.to_s} ||= TestCentricity::PageManager.find_page(:#{page_object.to_s});end;"
44
49
  end
50
+ result
45
51
  end
46
52
 
47
-
48
53
  # Have all PageObjects been registered?
49
54
  #
50
55
  # @return [Boolean] true if all PageObjects have been registered
@@ -85,8 +90,13 @@ module TestCentricity
85
90
  class DataManager
86
91
  @data_objects = {}
87
92
 
88
- def self.register_data_object(data_type, data_class)
89
- @data_objects[data_type] = data_class unless @data_objects.has_key?(data_type)
93
+ def self.register_data_objects(data)
94
+ result = ''
95
+ data.each do | data_type, data_class |
96
+ @data_objects[data_type] = data_class.new unless @data_objects.has_key?(data_type)
97
+ result = "#{result}def #{data_type.to_s};@#{data_type.to_s} ||= TestCentricity::DataManager.find_data_object(:#{data_type.to_s});end;"
98
+ end
99
+ result
90
100
  end
91
101
 
92
102
  def self.find_data_object(data_object)
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
@@ -8,12 +8,8 @@ module WorldData
8
8
  # return if data objects have already been instantiated and registered
9
9
  return if TestCentricity::DataManager.loaded?
10
10
 
11
- data_objects.each do | data_type, data_class |
12
- # register the data object
13
- TestCentricity::DataManager.register_data_object(data_type, data_class.new)
14
- # instantiate the data object
15
- eval("def #{data_type.to_s};@#{data_type.to_s} ||= TestCentricity::DataManager.find_data_object(:#{data_type.to_s});end")
16
- end
11
+ # register and instantiate all data objects
12
+ eval(TestCentricity::DataManager.register_data_objects(data_objects))
17
13
  end
18
14
  end
19
15
 
@@ -24,11 +20,7 @@ module WorldPages
24
20
  # return if page objects have already been instantiated and registered
25
21
  return if TestCentricity::PageManager.loaded?
26
22
 
27
- page_objects.each do | page_object, page_class |
28
- # register the page object
29
- TestCentricity::PageManager.register_page_object(page_object, page_class.new)
30
- # instantiate the page object
31
- eval("def #{page_object.to_s};@#{page_object.to_s} ||= TestCentricity::PageManager.find_page(:#{page_object.to_s});end")
32
- end
23
+ # register and instantiate all page objects
24
+ eval(TestCentricity::PageManager.register_page_objects(page_objects))
33
25
  end
34
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testcentricity_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - A.J. Mrozinski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-16 00:00:00.000000000 Z
11
+ date: 2016-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler