ole-qa-framework 3.6.0 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YjdjZmM2NTU0ZmFmMTBmYjhiN2YwOTQ1ZmE2NmQ3NTRjMjU0OTZjOA==
5
+ data.tar.gz: !binary |-
6
+ ZTA2YmMyYjhkODY2MzJjYjRhODNmMmYzYzIxNGYzNGFlMTc1Y2E3Ng==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZGI5ZGI0OTcxMzFiNzUzYWI3NDkzNzA5OTcyZWMzMGMwZmI3NzA0ZThmNDlj
10
+ M2ZhNzkyZTBiY2IxYjgzMGViNzc1ZTliN2M2ZjI3YjFmNGJmZDk2MjcwODBi
11
+ NWE5ZWM3YTliNDEyY2ZhNGFhNWQyNTYwZjdhMWViMDFlZDY4MGE=
12
+ data.tar.gz: !binary |-
13
+ YWQ1MmFkYWZjY2IzOWJhZWQ2YzYyMzNmMTFmMzg5YjA4ZTMzNzU0MDMxMDI5
14
+ MjU3MjNiODc1MDBhYTM4NGNmZjE4MzI4NzI4ODk3Nzc2MjU3NzU2ZTMzNjcz
15
+ MWM5YjYzNGZlZTg5M2QwMjRmY2U1ZTk4OTE0NTlkMzUyMDhmNDc=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### v3.6.1 - 2013/12/11
2
+
3
+ * Patron Data Factory
4
+ * Added .patron_new to create minimum required data for new patron record
5
+
1
6
  ### v3.6.0 - 2013/12/10
2
7
 
3
8
  * Patron Data Factory
data/data/states.yml ADDED
@@ -0,0 +1,51 @@
1
+ ---
2
+ - Alabama
3
+ - Alaska
4
+ - Arizona
5
+ - Arkansas
6
+ - California
7
+ - Colorado
8
+ - Connecticut
9
+ - Delaware
10
+ - Florida
11
+ - Georgia
12
+ - Hawaii
13
+ - Idaho
14
+ - Illinois
15
+ - Indiana
16
+ - Iowa
17
+ - Kansas
18
+ - Kentucky
19
+ - Louisiana
20
+ - Maine
21
+ - Maryland
22
+ - Massachusetts
23
+ - Michigan
24
+ - Minnesota
25
+ - Mississippi
26
+ - Missouri
27
+ - Montana
28
+ - Nebraska
29
+ - Nevada
30
+ - New Hampshire
31
+ - New Jersey
32
+ - New Mexico
33
+ - New York
34
+ - North Carolina
35
+ - North Dakota
36
+ - Ohio
37
+ - Oklahoma
38
+ - Oregon
39
+ - Pennsylvania
40
+ - Rhode Island
41
+ - South Carolina
42
+ - South Dakota
43
+ - Tennessee
44
+ - Texas
45
+ - Utah
46
+ - Vermont
47
+ - Virginia
48
+ - Washington
49
+ - West Virginia
50
+ - Wisconsin
51
+ - Wyoming
@@ -27,6 +27,50 @@ module OLE_QA::Framework
27
27
  def select_patron
28
28
  @patron_matrix.sample
29
29
  end
30
+
31
+ def new_patron
32
+ patron = Hash.new
33
+ states = YAML.load(File.read('data/states.yml'))
34
+ patron[:first] = name_builder(sampler(2..8))
35
+ patron[:last] = name_builder(sampler(6..8))
36
+ patron[:barcode] = num_str(sampler(6..12))
37
+ patron[:address] = num_str(sampler(3..5)) + ' ' + name_builder(sampler(4..8)) + ' ' + name_builder(2)
38
+ patron[:city] = name_builder(sampler(4..12))
39
+ patron[:state] = states.sample.upcase
40
+ patron[:postal_code] = num_str(5)
41
+ patron[:phone] = num_str(3) + '-' + num_str(3) + '-' + num_str(4)
42
+ patron[:email] = patron[:first] + patron[:last] + '@' + str(sampler(4..8)) + '.' + str(3)
43
+ patron
44
+ end
45
+
46
+ def name_builder(max_len = 8)
47
+ out = Array.new
48
+ out << sampler
49
+ max_len.times do
50
+ out << sampler('a'..'z')
51
+ end
52
+ out.join
53
+ end
54
+ private :name_builder
55
+
56
+ def sampler(r = 'A'..'Z')
57
+ r.to_a.sample
58
+ end
59
+ private :sampler
60
+
61
+ def str(len=8)
62
+ ary = Array.new
63
+ len.times { ary << sampler('a'..'z') }
64
+ ary.join
65
+ end
66
+ private :str
67
+
68
+ def num_str(len = 8)
69
+ ary = Array.new
70
+ len.times { ary << sampler('0'..'9') }
71
+ ary.join
72
+ end
73
+ private :num_str
30
74
  end
31
75
  end
32
76
  end
@@ -15,6 +15,6 @@
15
15
  module OLE_QA
16
16
  module Framework
17
17
  # The version number for this project.
18
- VERSION = '3.6.0'
18
+ VERSION = '3.6.1'
19
19
  end
20
20
  end
@@ -26,4 +26,18 @@ describe 'The Patron Factory' do
26
26
  patron.should be_a(Hash)
27
27
  patron.should include(:id, :first, :last, :barcode)
28
28
  end
29
+
30
+ it 'should return a new patron' do
31
+ patron = OLE_QA::Framework::Patron_Factory.new_patron
32
+ patron.should be_a(Hash)
33
+ patron[:first].should =~ /[A-Z]{1}[a-z]+/
34
+ patron[:last].should =~ /[A-Z]{1}[a-z]+/
35
+ patron[:barcode].should =~ /[0-9]+/
36
+ patron[:address].should =~ /[0-9]+\s[A-Z]{1}[a-z]+\s[A-Z]{1}[a-z]{1}/
37
+ patron[:city].should =~ /[A-Z]{1}[a-z]+/
38
+ patron[:state].should =~ /[A-Z]+/ || /[A-Z]+\s[A-Z]+/
39
+ patron[:postal_code].should =~ /[0-9]{5}/
40
+ patron[:phone].should =~ /[0-9]{3}\-[0-9]{3}\-[0-9]{4}/
41
+ patron[:email].should =~ /[A-Z,a-z]+\@[a-z]+\.[a-z]{3}/
42
+ end
29
43
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ole-qa-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.0
5
- prerelease:
4
+ version: 3.6.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jain Waldrip
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-12-10 00:00:00.000000000 Z
11
+ date: 2013-12-11 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: yard
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: watir-webdriver
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: headless
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ! '>='
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rspec
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ! '>='
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ! '>='
108
95
  - !ruby/object:Gem::Version
@@ -124,6 +111,7 @@ files:
124
111
  - data/accounts.yml
125
112
  - data/objects.yml
126
113
  - data/patron.yml
114
+ - data/states.yml
127
115
  - lib/common/common_object.rb
128
116
  - lib/common/data_object.rb
129
117
  - lib/common/line_object.rb
@@ -224,27 +212,26 @@ files:
224
212
  homepage: http://www.github.com/jkwaldrip/ole-qa-framework/
225
213
  licenses:
226
214
  - ECLv2
215
+ metadata: {}
227
216
  post_install_message:
228
217
  rdoc_options: []
229
218
  require_paths:
230
219
  - lib
231
220
  required_ruby_version: !ruby/object:Gem::Requirement
232
- none: false
233
221
  requirements:
234
222
  - - ~>
235
223
  - !ruby/object:Gem::Version
236
224
  version: 1.9.3
237
225
  required_rubygems_version: !ruby/object:Gem::Requirement
238
- none: false
239
226
  requirements:
240
227
  - - ! '>='
241
228
  - !ruby/object:Gem::Version
242
229
  version: '0'
243
230
  requirements: []
244
231
  rubyforge_project:
245
- rubygems_version: 1.8.23
232
+ rubygems_version: 2.1.11
246
233
  signing_key:
247
- specification_version: 3
234
+ specification_version: 4
248
235
  summary: Kuali Open Library Environment
249
236
  test_files:
250
237
  - spec/common/browser_spec.rb