factory_girl-preload 0.1.1 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- factory_girl-preload (0.1.1)
5
- factory_girl (~> 1.3.3)
4
+ factory_girl-preload (1.0.0.rc1)
5
+ factory_girl (>= 2.0.0.rc4)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
10
  abstract (1.0.0)
11
- actionpack (3.0.6)
12
- activemodel (= 3.0.6)
13
- activesupport (= 3.0.6)
11
+ actionpack (3.0.9)
12
+ activemodel (= 3.0.9)
13
+ activesupport (= 3.0.9)
14
14
  builder (~> 2.1.2)
15
15
  erubis (~> 2.6.6)
16
16
  i18n (~> 0.5.0)
@@ -18,44 +18,46 @@ GEM
18
18
  rack-mount (~> 0.6.14)
19
19
  rack-test (~> 0.5.7)
20
20
  tzinfo (~> 0.3.23)
21
- activemodel (3.0.6)
22
- activesupport (= 3.0.6)
21
+ activemodel (3.0.9)
22
+ activesupport (= 3.0.9)
23
23
  builder (~> 2.1.2)
24
24
  i18n (~> 0.5.0)
25
- activerecord (3.0.6)
26
- activemodel (= 3.0.6)
27
- activesupport (= 3.0.6)
28
- arel (~> 2.0.2)
25
+ activerecord (3.0.9)
26
+ activemodel (= 3.0.9)
27
+ activesupport (= 3.0.9)
28
+ arel (~> 2.0.10)
29
29
  tzinfo (~> 0.3.23)
30
- activesupport (3.0.6)
30
+ activesupport (3.0.9)
31
31
  archive-tar-minitar (0.5.2)
32
- arel (2.0.9)
32
+ arel (2.0.10)
33
33
  builder (2.1.2)
34
- columnize (0.3.2)
34
+ columnize (0.3.4)
35
35
  diff-lcs (1.1.2)
36
36
  erubis (2.6.6)
37
37
  abstract (>= 1.0.0)
38
- factory_girl (1.3.3)
38
+ factory_girl (2.0.0.rc4)
39
39
  i18n (0.5.0)
40
40
  linecache19 (0.5.12)
41
41
  ruby_core_source (>= 0.1.4)
42
- mysql2 (0.2.7)
43
- rack (1.2.2)
42
+ mysql2 (0.2.11)
43
+ rack (1.2.3)
44
44
  rack-mount (0.6.14)
45
45
  rack (>= 1.0.0)
46
46
  rack-test (0.5.7)
47
47
  rack (>= 1.0)
48
- railties (3.0.6)
49
- actionpack (= 3.0.6)
50
- activesupport (= 3.0.6)
48
+ railties (3.0.9)
49
+ actionpack (= 3.0.9)
50
+ activesupport (= 3.0.9)
51
51
  rake (>= 0.8.7)
52
+ rdoc (~> 3.4)
52
53
  thor (~> 0.14.4)
53
- rake (0.8.7)
54
+ rake (0.9.2)
55
+ rdoc (3.8)
54
56
  rspec (2.5.0)
55
57
  rspec-core (~> 2.5.0)
56
58
  rspec-expectations (~> 2.5.0)
57
59
  rspec-mocks (~> 2.5.0)
58
- rspec-core (2.5.1)
60
+ rspec-core (2.5.2)
59
61
  rspec-expectations (2.5.0)
60
62
  diff-lcs (~> 1.1.2)
61
63
  rspec-mocks (2.5.0)
@@ -75,7 +77,7 @@ GEM
75
77
  ruby_core_source (0.1.5)
76
78
  archive-tar-minitar (>= 0.5.2)
77
79
  thor (0.14.6)
78
- tzinfo (0.3.26)
80
+ tzinfo (0.3.29)
79
81
 
80
82
  PLATFORMS
81
83
  ruby
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
18
  s.require_paths = ["lib"]
19
19
 
20
- s.add_dependency "factory_girl", "~> 1.3.3"
20
+ s.add_dependency "factory_girl", ">= 2.0.0.rc4"
21
21
  s.add_development_dependency "ruby-debug19" if RUBY_VERSION >= "1.9"
22
22
  s.add_development_dependency "activerecord", "~> 3.0.6"
23
23
  s.add_development_dependency "actionpack", "~> 3.0.6"
@@ -0,0 +1,17 @@
1
+ module Factory
2
+ def self.preload(&block)
3
+ Preload.preloaders << block
4
+ end
5
+ end
6
+
7
+ module FactoryGirl
8
+ module Syntax
9
+ module Default
10
+ class DSL
11
+ def preload(&block)
12
+ ::Factory.preload(&block)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,4 +1,4 @@
1
- class Factory
1
+ module Factory
2
2
  module Preload
3
3
  module Helpers
4
4
  def self.extended(base)
@@ -1,10 +1,10 @@
1
- class Factory
1
+ module Factory
2
2
  module Preload
3
3
  module Version
4
- MAJOR = 0
5
- MINOR = 1
6
- PATCH = 1
7
- STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
4
+ MAJOR = 1
5
+ MINOR = 0
6
+ PATCH = 0
7
+ STRING = "#{MAJOR}.#{MINOR}.#{PATCH}.rc1"
8
8
  end
9
9
  end
10
10
  end
@@ -1,9 +1,10 @@
1
- class Factory
1
+ module Factory
2
2
  module Preload
3
3
  autoload :Helpers, "factory_girl/preload/helpers"
4
4
  autoload :Version, "factory_girl/preload/version"
5
5
 
6
6
  require "factory_girl/preload/rspec2" if defined?(RSpec)
7
+ require "factory_girl/preload/extension"
7
8
 
8
9
  class << self
9
10
  attr_accessor :preloaders
@@ -37,8 +38,4 @@ class Factory
37
38
  end
38
39
  end
39
40
  end
40
-
41
- def self.preload(&block)
42
- Preload.preloaders << block
43
- end
44
41
  end
data/spec/spec_helper.rb CHANGED
@@ -26,9 +26,4 @@ RSpec.configure do |config|
26
26
  config.use_transactional_fixtures = true
27
27
  end
28
28
 
29
- Factory.preload do
30
- factory(:john) { Factory(:user) }
31
- factory(:ruby) { Factory(:skill, :user => users(:john)) }
32
- end
33
-
34
29
  Factory::Preload.run
@@ -1,12 +1,15 @@
1
- Factory.define :user do |f|
2
- f.name "John Doe"
3
- f.email { Factory.next(:email) }
4
- end
1
+ FactoryGirl.define do
2
+ factory :user do |f|
3
+ f.name "John Doe"
4
+ f.sequence(:email) {|n| "john#{n}@doe.com"}
5
+ end
5
6
 
6
- Factory.sequence :email do |i|
7
- "john#{i}@doe.com"
8
- end
7
+ factory :skill do |f|
8
+ f.association :user
9
+ end
9
10
 
10
- Factory.define :skill do |f|
11
- f.association :user
12
- end
11
+ preload do
12
+ factory(:john) { Factory(:user) }
13
+ factory(:ruby) { Factory(:skill, :user => users(:john)) }
14
+ end
15
+ end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_girl-preload
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.1.1
4
+ prerelease: 6
5
+ version: 1.0.0.rc1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Nando Vieira
@@ -10,22 +10,21 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-06-08 00:00:00 Z
13
+ date: 2011-07-15 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: factory_girl
17
- prerelease: false
18
17
  requirement: &id001 !ruby/object:Gem::Requirement
19
18
  none: false
20
19
  requirements:
21
- - - ~>
20
+ - - ">="
22
21
  - !ruby/object:Gem::Version
23
- version: 1.3.3
22
+ version: 2.0.0.rc4
24
23
  type: :runtime
24
+ prerelease: false
25
25
  version_requirements: *id001
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: ruby-debug19
28
- prerelease: false
29
28
  requirement: &id002 !ruby/object:Gem::Requirement
30
29
  none: false
31
30
  requirements:
@@ -33,10 +32,10 @@ dependencies:
33
32
  - !ruby/object:Gem::Version
34
33
  version: "0"
35
34
  type: :development
35
+ prerelease: false
36
36
  version_requirements: *id002
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: activerecord
39
- prerelease: false
40
39
  requirement: &id003 !ruby/object:Gem::Requirement
41
40
  none: false
42
41
  requirements:
@@ -44,10 +43,10 @@ dependencies:
44
43
  - !ruby/object:Gem::Version
45
44
  version: 3.0.6
46
45
  type: :development
46
+ prerelease: false
47
47
  version_requirements: *id003
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: actionpack
50
- prerelease: false
51
50
  requirement: &id004 !ruby/object:Gem::Requirement
52
51
  none: false
53
52
  requirements:
@@ -55,10 +54,10 @@ dependencies:
55
54
  - !ruby/object:Gem::Version
56
55
  version: 3.0.6
57
56
  type: :development
57
+ prerelease: false
58
58
  version_requirements: *id004
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rspec-rails
61
- prerelease: false
62
61
  requirement: &id005 !ruby/object:Gem::Requirement
63
62
  none: false
64
63
  requirements:
@@ -66,10 +65,10 @@ dependencies:
66
65
  - !ruby/object:Gem::Version
67
66
  version: 2.5.0
68
67
  type: :development
68
+ prerelease: false
69
69
  version_requirements: *id005
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: mysql2
72
- prerelease: false
73
72
  requirement: &id006 !ruby/object:Gem::Requirement
74
73
  none: false
75
74
  requirements:
@@ -77,6 +76,7 @@ dependencies:
77
76
  - !ruby/object:Gem::Version
78
77
  version: 0.2.7
79
78
  type: :development
79
+ prerelease: false
80
80
  version_requirements: *id006
81
81
  description: Preload factories (Factory Girl) just like fixtures. It will be easy and, probably, faster!
82
82
  email:
@@ -97,6 +97,7 @@ files:
97
97
  - factory_girl-preload.gemspec
98
98
  - lib/factory_girl-preload.rb
99
99
  - lib/factory_girl/preload.rb
100
+ - lib/factory_girl/preload/extension.rb
100
101
  - lib/factory_girl/preload/helpers.rb
101
102
  - lib/factory_girl/preload/rspec2.rb
102
103
  - lib/factory_girl/preload/version.rb
@@ -120,13 +121,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
121
  requirements:
121
122
  - - ">="
122
123
  - !ruby/object:Gem::Version
124
+ hash: -3948946033246578233
125
+ segments:
126
+ - 0
123
127
  version: "0"
124
128
  required_rubygems_version: !ruby/object:Gem::Requirement
125
129
  none: false
126
130
  requirements:
127
- - - ">="
131
+ - - ">"
128
132
  - !ruby/object:Gem::Version
129
- version: "0"
133
+ version: 1.3.1
130
134
  requirements: []
131
135
 
132
136
  rubyforge_project: