fixture_builder 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -89,7 +89,7 @@ module FixtureBuilder
89
89
  fixtures = tables.inject([]) do |files, table_name|
90
90
  table_klass = table_name.classify.constantize rescue nil
91
91
  if table_klass
92
- rows = table_klass.all.collect(&:attributes)
92
+ rows = table_klass.unscoped { table_klass.all.collect(&:attributes) }
93
93
  else
94
94
  rows = ActiveRecord::Base.connection.select_all(select_sql % ActiveRecord::Base.connection.quote_table_name(table_name))
95
95
  end
@@ -1,3 +1,3 @@
1
1
  module FixtureBuilder
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end
@@ -10,6 +10,7 @@ class LegacyFixtureModeFixtureGenerationTest < Test::Unit::TestCase
10
10
  fbuilder.legacy_fixtures = Dir[test_path("legacy_fixtures/*.yml"), test_path("other_legacy_fixture_set/*.yml")]
11
11
  fbuilder.factory do
12
12
  MagicalCreature.create(:name => "frank", :species => "unicorn")
13
+ MagicalCreature.create(:name => "loch ness monster", :species => "sea creature", :deleted => true)
13
14
  end
14
15
  end
15
16
 
@@ -38,6 +39,7 @@ class LegacyFixtureModeFixtureGenerationTest < Test::Unit::TestCase
38
39
  def test_new_fixtures_are_created
39
40
  assert_equal "frank", @@magical_creatures['frank']['name']
40
41
  assert_equal "unicorn", @@magical_creatures['frank']['species']
42
+ assert_equal "loch ness monster", @@magical_creatures['loch_ness_monster']['name']
41
43
  end
42
44
 
43
45
  def test_legacy_fixtures_retain_fixture_name
data/test/test_helper.rb CHANGED
@@ -26,6 +26,7 @@ require 'fixture_builder'
26
26
 
27
27
  class MagicalCreature < ActiveRecord::Base
28
28
  validates_presence_of :name, :species
29
+ default_scope :conditions => { :deleted => false }
29
30
  end
30
31
 
31
32
  def create_and_blow_away_old_db
@@ -38,6 +39,7 @@ def create_and_blow_away_old_db
38
39
  ActiveRecord::Base.connection.create_table(:magical_creatures, :force => true) do |t|
39
40
  t.column :name, :string
40
41
  t.column :species, :string
42
+ t.column :deleted, :boolean, :default => false, :null => false
41
43
  end
42
44
  end
43
45
 
metadata CHANGED
@@ -1,119 +1,121 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: fixture_builder
3
- version: !ruby/object:Gem::Version
4
- hash: 21
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.4
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 3
9
- - 3
10
- version: 0.3.3
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Ryan Dy
14
9
  - David Stevenson
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2012-02-18 00:00:00 -08:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
13
+ date: 2012-08-22 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
23
16
  name: activerecord
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
26
18
  none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 7
31
- segments:
32
- - 2
33
- version: "2"
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '2'
34
23
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: activesupport
38
24
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: !ruby/object:Gem::Requirement
40
26
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 7
45
- segments:
46
- - 2
47
- version: "2"
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '2'
31
+ - !ruby/object:Gem::Dependency
32
+ name: activesupport
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '2'
48
39
  type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: rake
52
40
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
41
+ version_requirements: !ruby/object:Gem::Requirement
54
42
  none: false
55
- requirements:
56
- - - "="
57
- - !ruby/object:Gem::Version
58
- hash: 49
59
- segments:
60
- - 0
61
- - 8
62
- - 7
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '2'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
63
54
  version: 0.8.7
64
55
  type: :development
65
- version_requirements: *id003
66
- - !ruby/object:Gem::Dependency
67
- name: rails
68
56
  prerelease: false
69
- requirement: &id004 !ruby/object:Gem::Requirement
57
+ version_requirements: !ruby/object:Gem::Requirement
70
58
  none: false
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- hash: 7
75
- segments:
76
- - 2
77
- version: "2"
59
+ requirements:
60
+ - - '='
61
+ - !ruby/object:Gem::Version
62
+ version: 0.8.7
63
+ - !ruby/object:Gem::Dependency
64
+ name: rails
65
+ requirement: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '2'
78
71
  type: :development
79
- version_requirements: *id004
80
- - !ruby/object:Gem::Dependency
81
- name: test-unit
82
72
  prerelease: false
83
- requirement: &id005 !ruby/object:Gem::Requirement
73
+ version_requirements: !ruby/object:Gem::Requirement
84
74
  none: false
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- hash: 3
89
- segments:
90
- - 0
91
- version: "0"
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '2'
79
+ - !ruby/object:Gem::Dependency
80
+ name: test-unit
81
+ requirement: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
92
87
  type: :development
93
- version_requirements: *id005
94
- - !ruby/object:Gem::Dependency
95
- name: sqlite3
96
88
  prerelease: false
97
- requirement: &id006 !ruby/object:Gem::Requirement
89
+ version_requirements: !ruby/object:Gem::Requirement
98
90
  none: false
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- hash: 3
103
- segments:
104
- - 0
105
- version: "0"
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ - !ruby/object:Gem::Dependency
96
+ name: sqlite3
97
+ requirement: !ruby/object:Gem::Requirement
98
+ none: false
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
106
103
  type: :development
107
- version_requirements: *id006
108
- description: FixtureBuilder allows testers to use their existing factories, like FactoryGirl, to generate high performance fixtures that can be shared across all your tests
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: FixtureBuilder allows testers to use their existing factories, like FactoryGirl,
112
+ to generate high performance fixtures that can be shared across all your tests
109
113
  email: mail@ryandy.com
110
114
  executables: []
111
-
112
115
  extensions: []
113
-
114
- extra_rdoc_files:
116
+ extra_rdoc_files:
115
117
  - README.markdown
116
- files:
118
+ files:
117
119
  - .gitignore
118
120
  - .pairs
119
121
  - .rvmrc
@@ -138,41 +140,31 @@ files:
138
140
  - test/namer_test.rb
139
141
  - test/test_helper.rb
140
142
  - tmp/.gitkeep
141
- has_rdoc: true
142
143
  homepage: http://github.com/rdy/fixture_builder
143
144
  licenses: []
144
-
145
145
  post_install_message:
146
146
  rdoc_options: []
147
-
148
- require_paths:
147
+ require_paths:
149
148
  - lib
150
- required_ruby_version: !ruby/object:Gem::Requirement
149
+ required_ruby_version: !ruby/object:Gem::Requirement
151
150
  none: false
152
- requirements:
153
- - - ">="
154
- - !ruby/object:Gem::Version
155
- hash: 3
156
- segments:
157
- - 0
158
- version: "0"
159
- required_rubygems_version: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ! '>='
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
155
+ required_rubygems_version: !ruby/object:Gem::Requirement
160
156
  none: false
161
- requirements:
162
- - - ">="
163
- - !ruby/object:Gem::Version
164
- hash: 3
165
- segments:
166
- - 0
167
- version: "0"
157
+ requirements:
158
+ - - ! '>='
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
168
161
  requirements: []
169
-
170
162
  rubyforge_project: fixture_builder
171
- rubygems_version: 1.6.2
163
+ rubygems_version: 1.8.19
172
164
  signing_key:
173
165
  specification_version: 3
174
166
  summary: Build YAML fixtures using object factories
175
- test_files:
167
+ test_files:
176
168
  - test/fixture_builder_test.rb
177
169
  - test/fixtures/.gitkeep
178
170
  - test/legacy_fixture_mode_fixture_generation_test.rb