test-factory 0.3.1 → 0.3.2

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
- NzIyZGE4MzdhMjg4YzVjZTM5MWE5MjVlN2IzZGZkY2FiZWRkYjA5YQ==
4
+ ZDVhZDU2MWVhOGYxZWM3MzU2MWMxYzI0YjRiM2ZhMmM0MWYxY2RkOQ==
5
5
  data.tar.gz: !binary |-
6
- Mjk0MzMzYzdmZjViMTU3MmFhMDMzM2Q5NmUxZjRlMmRlNzgwODc3Yw==
6
+ Njk4MDRjMTRmNTgxZDIyY2IwNGVkZGNmM2Q2NGJkOTA0NTc2YWY4YQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZTIyOTI5Yzc1NDA3YTliMDg5YWMzOTU1OTY4ODQyODZiYjU2OTUyMzc5ZWU1
10
- ZWY3NGViZGYxZjcyYzVmMWY4ZDI2YzQxZmEyMWE1NDc3NDRlMjQyZjgxZTVl
11
- N2FlNzkxYWEyZDk3ZjI0ZWQ0OWU3NjZiYWRhNDQ5MzlkNGNiOTk=
9
+ MzRhYjVhMzM3ZjU3NDM0NGFhZjBjYWZiZWQyZTgwMTcxZmU3YzJmZGYyNzIx
10
+ ZTgyOGM4ZjQ3NzljZWM4YThhZWQxODAxYmRlZTc4YmViZjI4MDUxN2YxNTQw
11
+ MzQ4MDUzYmZlN2IyMWVhZDFlZmQ5OTU5MGZmN2EyNjgyNzY0Yjg=
12
12
  data.tar.gz: !binary |-
13
- NjY3ZmIxMjEyODFhN2JjYWQ5MDAwNTNjYmY1OTczZTc0OTI2MjQ1OWZkMzA2
14
- YmVkNzQ4MmQ2ZTJjOTc5YThlYzc3ZDlmYTBjOGJiM2M3MjRmZjFiNGQxMTE4
15
- YzI4ZGYyMWRhNTYzMTk3N2Q0YmM5NzA3YmU0M2Q1MzZmNTM5N2E=
13
+ ODFmOTA4ODRiNGRhNjg2NWRhMmVkNjAzNDY0Nzg4ZmNjMGRkYzJlZDk1NjY2
14
+ NDk4ZjAzZGEyZWUwNDhmYzc3NTAzM2ZiNDFkNmI5YTVlMGU5OTNmOWMzZGRj
15
+ MTM4OTY1ZTYzNWZjMzNlNjdjYjlhNjBhZjRlZWI2YmY5YjMzOTg=
@@ -183,9 +183,8 @@ module Watir
183
183
  private
184
184
 
185
185
  def select_at_random
186
- text_array = []
187
- options.each { |opt| text_array << opt.text }
188
- text_array.delete_if { |text| text=='select' || text=='' }
186
+ text_array = options.map { |opt| opt.text }
187
+ text_array.delete_if { |text| text=~/^select(.?)$/i || text=='' }
189
188
  item = text_array.sample
190
189
  select item
191
190
  item
@@ -85,6 +85,16 @@ module StringFactory
85
85
  s.to_s
86
86
  end
87
87
 
88
+ # Returns a String containing a number with two decimal places, for creation
89
+ # of dollar values.
90
+ # @param max [Integer] The highest allowable dollar amount
91
+ # @example
92
+ # random_dollar_value(100) => '44.89'
93
+ #
94
+ def random_dollar_value(max)
95
+ "#{rand(max)}.#{rand(99)}"
96
+ end
97
+
88
98
  # Returns a block of text (of the specified type, see below) containing
89
99
  # the specified number of "words" (each containing between 1 and 16 chars)
90
100
  # randomly spread across the specified number of lines (note that
Binary file
data/test-factory.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'test-factory'
3
- s.version = '0.3.1'
3
+ s.version = '0.3.2'
4
4
  s.summary = %q{rSmart's framework for creating automated testing scripts}
5
5
  s.description = %q{This gem provides a set of modules and methods to help quickly and DRYly create a test automation framework using Ruby and Watir (or watir-webdriver).}
6
6
  s.files = Dir.glob("**/**/**")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-factory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abraham Heward
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-04 00:00:00.000000000 Z
11
+ date: 2013-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: watir-webdriver
@@ -46,6 +46,7 @@ files:
46
46
  - lib/test-factory.rb
47
47
  - LICENSE
48
48
  - README.md
49
+ - test-factory-0.3.1.gem
49
50
  - test-factory.gemspec
50
51
  homepage: https://github.com/rSmart
51
52
  licenses: []