jelly_bird 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme.md +16 -0
- data/jelly_bird.gemspec +1 -0
- data/lib/jelly_bird/version.rb +1 -1
- metadata +24 -7
data/Readme.md
CHANGED
@@ -36,6 +36,22 @@ to generate object in test just use `.gen` like this `Dummy.gen` to get generate
|
|
36
36
|
other_dummy = Dummy.gen(:name => "dummy name")
|
37
37
|
# other_dummy[:name] => "dummy name"
|
38
38
|
|
39
|
+
# custom factories
|
40
|
+
you can define custom factories, and generate object using `.generate` mwthod with factory name like this.
|
41
|
+
|
42
|
+
Mummy.define {{
|
43
|
+
:left => /\w{3,10}/.gen,
|
44
|
+
:right => /\w{3,10}/.gen
|
45
|
+
}}
|
46
|
+
|
47
|
+
Mummy.define(:custom) {{
|
48
|
+
:center => /\w{3,10}/.gen
|
49
|
+
}}
|
50
|
+
|
51
|
+
mummy = Mummy.generate(:custom, :mumble => true)
|
52
|
+
|
53
|
+
in fact `.gen` is just calling generate with `:default` symbol.
|
54
|
+
|
39
55
|
# integration with rspec
|
40
56
|
|
41
57
|
touch a file with defines like `factories.rb` in spec folder and then require it inside of your `spec_helper.rb`. Then define all the factories like this.
|
data/jelly_bird.gemspec
CHANGED
data/lib/jelly_bird/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jelly_bird
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- JO
|
@@ -15,9 +15,25 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
|
20
|
-
|
18
|
+
date: 2011-08-12 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: randexp
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 17
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 1
|
33
|
+
- 5
|
34
|
+
version: 0.1.5
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
21
37
|
description: JellyBird is a ultra small factory to help generating objects for purpose of tests.
|
22
38
|
email:
|
23
39
|
- jakub.oboza@gmail.com
|
@@ -42,6 +58,7 @@ files:
|
|
42
58
|
- spec/jelly_bird/custom_builders_spec.rb
|
43
59
|
- spec/jelly_bird/jelly_bird_spec.rb
|
44
60
|
- spec/spec_helper.rb
|
61
|
+
has_rdoc: true
|
45
62
|
homepage: ""
|
46
63
|
licenses: []
|
47
64
|
|
@@ -71,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
88
|
requirements: []
|
72
89
|
|
73
90
|
rubyforge_project: jelly_bird
|
74
|
-
rubygems_version: 1.
|
91
|
+
rubygems_version: 1.6.2
|
75
92
|
signing_key:
|
76
93
|
specification_version: 3
|
77
94
|
summary: Ultra small gem for generating objects
|