jelly_bird 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +7 -0
- data/Gemfile +2 -2
- data/Readme.md +23 -12
- data/lib/jelly_bird/version.rb +1 -1
- metadata +32 -55
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/Readme.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Jelly Bird gem
|
2
2
|
|
3
|
+
Lightweight library for building objects in test/spec case's.
|
4
|
+
|
5
|
+
# Travis CI
|
6
|
+
[![Build Status](https://secure.travis-ci.org/JakubOboza/jellybird.png?branch=master)](http://travis-ci.org/JakubOboza/jellybird)
|
7
|
+
|
3
8
|
# instalation
|
4
9
|
|
5
10
|
type
|
@@ -37,7 +42,7 @@ to generate object in test just use `.gen` like this `Dummy.gen` to get generate
|
|
37
42
|
# other_dummy[:name] => "dummy name"
|
38
43
|
|
39
44
|
# custom factories
|
40
|
-
you can define custom factories, and generate object using `.generate`
|
45
|
+
you can define custom factories, and generate object using `.generate` method with factory name like this.
|
41
46
|
|
42
47
|
Mummy.define {{
|
43
48
|
:left => /\w{3,10}/.gen,
|
@@ -52,23 +57,29 @@ you can define custom factories, and generate object using `.generate` mwthod wi
|
|
52
57
|
|
53
58
|
in fact `.gen` is just calling generate with `:default` symbol.
|
54
59
|
|
60
|
+
# generate with hook
|
61
|
+
|
62
|
+
user = User.gen {|user| user.save }
|
63
|
+
|
64
|
+
doing this returns you object which received :save after generating
|
65
|
+
|
55
66
|
# integration with rspec
|
56
67
|
|
57
68
|
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.
|
58
69
|
|
59
70
|
|
60
|
-
User.define {{
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
}}
|
71
|
+
User.define {{
|
72
|
+
:first_name => /\w{3,9}/.gen,
|
73
|
+
:last_name => /\w{3,8}/.gen,
|
74
|
+
:email => /\w{3,8}@\w{3,8}\.com/.gen
|
75
|
+
}}
|
65
76
|
|
66
|
-
Family.define {{
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
}}
|
77
|
+
Family.define {{
|
78
|
+
:father => User.gen,
|
79
|
+
:mom => User.gen,
|
80
|
+
:kind => User.gen,
|
81
|
+
:family_name => /\w{3,8}/.gen
|
82
|
+
}}
|
72
83
|
|
73
84
|
|
74
85
|
remember that if you wanna embbed one into another please don't specify them at random order :).
|
data/lib/jelly_bird/version.rb
CHANGED
metadata
CHANGED
@@ -1,51 +1,38 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: jelly_bird
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 6
|
10
|
-
version: 0.0.6
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- JO
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-12-11 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: randexp
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70332076393640 !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 17
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 1
|
33
|
-
- 5
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
34
21
|
version: 0.1.5
|
35
22
|
type: :runtime
|
36
|
-
|
37
|
-
|
38
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70332076393640
|
25
|
+
description: JellyBird is a ultra small factory to help generating objects for purpose
|
26
|
+
of tests.
|
27
|
+
email:
|
39
28
|
- jakub.oboza@gmail.com
|
40
29
|
executables: []
|
41
|
-
|
42
30
|
extensions: []
|
43
|
-
|
44
31
|
extra_rdoc_files: []
|
45
|
-
|
46
|
-
files:
|
32
|
+
files:
|
47
33
|
- .gitignore
|
48
34
|
- .rspec
|
35
|
+
- .travis.yml
|
49
36
|
- Gemfile
|
50
37
|
- LICENCE
|
51
38
|
- Rakefile
|
@@ -58,41 +45,31 @@ files:
|
|
58
45
|
- spec/jelly_bird/custom_builders_spec.rb
|
59
46
|
- spec/jelly_bird/jelly_bird_spec.rb
|
60
47
|
- spec/spec_helper.rb
|
61
|
-
|
62
|
-
homepage: ""
|
48
|
+
homepage: ''
|
63
49
|
licenses: []
|
64
|
-
|
65
50
|
post_install_message:
|
66
51
|
rdoc_options: []
|
67
|
-
|
68
|
-
require_paths:
|
52
|
+
require_paths:
|
69
53
|
- lib
|
70
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
55
|
none: false
|
72
|
-
requirements:
|
73
|
-
- -
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
|
76
|
-
|
77
|
-
- 0
|
78
|
-
version: "0"
|
79
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
61
|
none: false
|
81
|
-
requirements:
|
82
|
-
- -
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
|
85
|
-
segments:
|
86
|
-
- 0
|
87
|
-
version: "0"
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
88
66
|
requirements: []
|
89
|
-
|
90
67
|
rubyforge_project: jelly_bird
|
91
|
-
rubygems_version: 1.
|
68
|
+
rubygems_version: 1.8.15
|
92
69
|
signing_key:
|
93
70
|
specification_version: 3
|
94
71
|
summary: Ultra small gem for generating objects
|
95
|
-
test_files:
|
72
|
+
test_files:
|
96
73
|
- spec/jelly_bird/custom_builders_spec.rb
|
97
74
|
- spec/jelly_bird/jelly_bird_spec.rb
|
98
75
|
- spec/spec_helper.rb
|