test-factory 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- test-factory (0.1.3)
4
+ test-factory (0.1.4)
5
5
  watir-webdriver (>= 0.6.1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -92,23 +92,23 @@ class YourDataObject
92
92
  # These are some example attributes...
93
93
  attr_accessor :title, :id, :link, :status, :description
94
94
 
95
- # Put any attributes here that you don't want to always have to define explicitly...
96
- DEFAULTS = {
97
- :title=>"My Data Title",
98
- :description=>"My Data's Description"
99
- # ...
100
- }
101
-
102
95
  # Your data object has to know about Watir's browser object, so it's passed to it here, along
103
96
  # with a hash containing all the attributes you want the data object to have
104
97
  def initialize(browser, opts={})
105
98
  @browser = browser
106
99
 
107
- # The set_options line combines the DEFAULTS
108
- # with any options you passed explicitly,
100
+ # Put any attributes here that you don't want to always have to define explicitly...
101
+ defaults = {
102
+ :title=>"My Data Title",
103
+ :description=>"My Data's Description"
104
+ # ...
105
+ }
106
+
107
+ # The set_options line combines the defaults
108
+ # with any options you passed explicitly in opts,
109
109
  # then turns all the contents of the options
110
110
  # Hash into YourDataObject's class instance variables
111
- set_options(DEFAULTS.merge(opts))
111
+ set_options(defaults.merge(opts))
112
112
 
113
113
  requires @id # This line allows you to specify any class instance variables that must
114
114
  # be explicitly defined for the data object
@@ -30,6 +30,17 @@ module Foundry
30
30
  data_object_class.new @browser, opts
31
31
  end
32
32
 
33
+ # An extension of the #make method that simplifies and improves
34
+ # the readability of your "create" step definitions by
35
+ # combining the make with the create. Of course, this
36
+ # requires that your data object classes properly follow the design
37
+ # pattern and have a #create method available.
38
+ def create data_object_class, opts={}
39
+ data_object = make data_object_class, opts
40
+ data_object.create
41
+ data_object
42
+ end
43
+
33
44
  # A helper method that takes a block of code and waits until it resolves to true.
34
45
  # Useful when you need to wait for something to be on a page that's a little more
35
46
  # involved than a simple element (for those, you should use the #expected_element
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.1.3'
3
+ s.version = '0.1.4'
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-factory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-16 00:00:00.000000000 Z
12
+ date: 2013-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: watir-webdriver