factory_girl-preload 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,44 +1,44 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- factory_girl-preload (2.0.0)
4
+ factory_girl-preload (2.0.1)
5
5
  factory_girl (~> 3.0)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- actionpack (3.2.2)
11
- activemodel (= 3.2.2)
12
- activesupport (= 3.2.2)
10
+ actionpack (3.2.3)
11
+ activemodel (= 3.2.3)
12
+ activesupport (= 3.2.3)
13
13
  builder (~> 3.0.0)
14
14
  erubis (~> 2.7.0)
15
15
  journey (~> 1.0.1)
16
16
  rack (~> 1.4.0)
17
- rack-cache (~> 1.1)
17
+ rack-cache (~> 1.2)
18
18
  rack-test (~> 0.6.1)
19
19
  sprockets (~> 2.1.2)
20
- activemodel (3.2.2)
21
- activesupport (= 3.2.2)
20
+ activemodel (3.2.3)
21
+ activesupport (= 3.2.3)
22
22
  builder (~> 3.0.0)
23
- activerecord (3.2.2)
24
- activemodel (= 3.2.2)
25
- activesupport (= 3.2.2)
23
+ activerecord (3.2.3)
24
+ activemodel (= 3.2.3)
25
+ activesupport (= 3.2.3)
26
26
  arel (~> 3.0.2)
27
27
  tzinfo (~> 0.3.29)
28
- activesupport (3.2.2)
28
+ activesupport (3.2.3)
29
29
  i18n (~> 0.6)
30
30
  multi_json (~> 1.0)
31
31
  arel (3.0.2)
32
32
  builder (3.0.0)
33
33
  diff-lcs (1.1.3)
34
34
  erubis (2.7.0)
35
- factory_girl (3.0.0)
35
+ factory_girl (3.2.0)
36
36
  activesupport (>= 3.0.0)
37
37
  hike (1.2.1)
38
38
  i18n (0.6.0)
39
39
  journey (1.0.3)
40
40
  json (1.6.6)
41
- multi_json (1.2.0)
41
+ multi_json (1.3.2)
42
42
  mysql2 (0.3.11)
43
43
  rack (1.4.1)
44
44
  rack-cache (1.2)
@@ -47,9 +47,9 @@ GEM
47
47
  rack
48
48
  rack-test (0.6.1)
49
49
  rack (>= 1.0)
50
- railties (3.2.2)
51
- actionpack (= 3.2.2)
52
- activesupport (= 3.2.2)
50
+ railties (3.2.3)
51
+ actionpack (= 3.2.3)
52
+ activesupport (= 3.2.3)
53
53
  rack-ssl (~> 1.3.2)
54
54
  rake (>= 0.8.7)
55
55
  rdoc (~> 3.4)
@@ -62,7 +62,7 @@ GEM
62
62
  rspec-expectations (~> 2.9.0)
63
63
  rspec-mocks (~> 2.9.0)
64
64
  rspec-core (2.9.0)
65
- rspec-expectations (2.9.0)
65
+ rspec-expectations (2.9.1)
66
66
  diff-lcs (~> 1.1.3)
67
67
  rspec-mocks (2.9.0)
68
68
  rspec-rails (2.9.0)
@@ -76,7 +76,7 @@ GEM
76
76
  tilt (~> 1.1, != 1.3.0)
77
77
  thor (0.14.6)
78
78
  tilt (1.3.3)
79
- tzinfo (0.3.32)
79
+ tzinfo (0.3.33)
80
80
 
81
81
  PLATFORMS
82
82
  ruby
@@ -15,7 +15,7 @@ module FactoryGirl
15
15
 
16
16
  class_eval <<-RUBY, __FILE__, __LINE__
17
17
  def #{method_name}(name)
18
- factory(name, #{model})
18
+ factory(name, ::#{model})
19
19
  end
20
20
  RUBY
21
21
  end
@@ -3,7 +3,7 @@ module FactoryGirl
3
3
  module Version
4
4
  MAJOR = 2
5
5
  MINOR = 0
6
- PATCH = 0
6
+ PATCH = 1
7
7
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
8
8
  end
9
9
  end
@@ -21,6 +21,10 @@ describe FactoryGirl::Preload do
21
21
  skills(:ruby).should be_a(Skill)
22
22
  end
23
23
 
24
+ it "returns :my factory for Preload model" do
25
+ preloads(:my).should be_a(Preload)
26
+ end
27
+
24
28
  it "reuses existing factories" do
25
29
  skills(:ruby).user.should == users(:john)
26
30
  end
@@ -0,0 +1,2 @@
1
+ class Preload < ActiveRecord::Base
2
+ end
@@ -2,6 +2,7 @@ ActiveRecord::Schema.define(:version => 0) do
2
2
  begin
3
3
  drop_table :users
4
4
  drop_table :skills
5
+ drop_table :preloads
5
6
  rescue Exception => e
6
7
  end
7
8
 
@@ -13,6 +14,10 @@ ActiveRecord::Schema.define(:version => 0) do
13
14
 
14
15
  add_index :users, :email, :unique => true
15
16
 
17
+ create_table :preloads do |t|
18
+ t.string :name
19
+ end
20
+
16
21
  create_table :skills do |t|
17
22
  t.references :user
18
23
  end
@@ -8,8 +8,13 @@ FactoryGirl.define do
8
8
  f.association :user
9
9
  end
10
10
 
11
+ factory :preload do |f|
12
+ f.name "My Preload"
13
+ end
14
+
11
15
  preload do
12
16
  factory(:john) { create(:user) }
13
17
  factory(:ruby) { create(:skill, :user => users(:john)) }
18
+ factory(:my) { create(:preload) }
14
19
  end
15
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_girl-preload
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-27 00:00:00.000000000 Z
12
+ date: 2012-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: factory_girl
16
- requirement: &70279175524660 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70279175524660
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '3.0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: activerecord
27
- requirement: &70279175524100 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '3.1'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70279175524100
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '3.1'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: actionpack
38
- requirement: &70279175523400 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '3.1'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70279175523400
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '3.1'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: rspec-rails
49
- requirement: &70279175522860 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ~>
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: '2.7'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *70279175522860
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '2.7'
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: mysql2
60
- requirement: &70279175522160 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ~>
@@ -65,7 +85,12 @@ dependencies:
65
85
  version: '0.3'
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *70279175522160
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '0.3'
69
94
  description: Preload factories (Factory Girl) just like fixtures. It will be easy
70
95
  and, probably, faster!
71
96
  email:
@@ -89,6 +114,7 @@ files:
89
114
  - lib/factory_girl/preload/version.rb
90
115
  - spec/factory_girl/preload_spec.rb
91
116
  - spec/spec_helper.rb
117
+ - spec/support/app/app/models/preload.rb
92
118
  - spec/support/app/app/models/skill.rb
93
119
  - spec/support/app/app/models/user.rb
94
120
  - spec/support/app/config/database.yml
@@ -108,7 +134,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
134
  version: '0'
109
135
  segments:
110
136
  - 0
111
- hash: -816435126381893825
137
+ hash: 3411879587882258032
112
138
  required_rubygems_version: !ruby/object:Gem::Requirement
113
139
  none: false
114
140
  requirements:
@@ -117,10 +143,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
143
  version: '0'
118
144
  segments:
119
145
  - 0
120
- hash: -816435126381893825
146
+ hash: 3411879587882258032
121
147
  requirements: []
122
148
  rubyforge_project:
123
- rubygems_version: 1.8.11
149
+ rubygems_version: 1.8.23
124
150
  signing_key:
125
151
  specification_version: 3
126
152
  summary: Preload factories (Factory Girl) just like fixtures. It will be easy and,
@@ -128,6 +154,7 @@ summary: Preload factories (Factory Girl) just like fixtures. It will be easy an
128
154
  test_files:
129
155
  - spec/factory_girl/preload_spec.rb
130
156
  - spec/spec_helper.rb
157
+ - spec/support/app/app/models/preload.rb
131
158
  - spec/support/app/app/models/skill.rb
132
159
  - spec/support/app/app/models/user.rb
133
160
  - spec/support/app/config/database.yml