with_model 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec CHANGED
@@ -1 +1,2 @@
1
- --colour
1
+ --color
2
+ --format documentation
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ ### 0.2.4
2
+
3
+ Active Record 3.1 compatible.
4
+ Fix bug where column information was being cached incorrectly by Active
5
+ Record.
6
+
1
7
  ### 0.2.3
2
8
 
3
9
  Create a new class each run to prevent test pollution. (J. Andrew Marshall)
@@ -1,11 +1,9 @@
1
1
  source :rubygems
2
2
 
3
- # gemspec :path => File.join(File.dirname(__FILE__), '..')
4
-
5
3
  gem "mixico"
6
4
  gem "rake"
7
5
 
8
6
  group :test do
9
7
  gem "autotest"
10
- gem "sqlite3-ruby"
8
+ gem "sqlite3"
11
9
  end
@@ -2,4 +2,4 @@ filename = File.join(File.dirname(__FILE__), '..', 'Gemfile.common')
2
2
  eval(File.read(filename), binding, filename, 1)
3
3
 
4
4
  gem "rspec", "~>1.0"
5
- gem "activerecord", "~>2.3.5"
5
+ gem "activerecord", "~>2.3"
@@ -1,6 +1,4 @@
1
1
  filename = File.join(File.dirname(__FILE__), '..', 'Gemfile.common')
2
2
  eval(File.read(filename), binding, filename, 1)
3
3
 
4
- gem "rspec", "~>2.0"
5
- gem "activerecord", "~>3.0.0"
6
-
4
+ gemspec :path => File.join(File.dirname(__FILE__), '..', '..')
data/lib/with_model.rb CHANGED
@@ -13,7 +13,7 @@ module WithModel
13
13
  end
14
14
 
15
15
  after do
16
- connection.drop_table(name) rescue nil
16
+ connection.drop_table(name)
17
17
  end
18
18
  end
19
19
  end
@@ -32,6 +32,8 @@ module WithModel
32
32
 
33
33
  model = nil
34
34
 
35
+ @example_group.with_table(table_name, @table_options, &@table_block)
36
+
35
37
  @example_group.before do
36
38
  model = Class.new(WithModel::Base)
37
39
  silence_warnings { Object.const_set(const_name, model) }
@@ -39,6 +41,7 @@ module WithModel
39
41
  set_table_name table_name
40
42
  self.class_eval(&model_initialization)
41
43
  end
44
+ model.reset_column_information
42
45
  end
43
46
 
44
47
  @example_group.after do
@@ -46,8 +49,6 @@ module WithModel
46
49
  Object.send(:remove_const, const_name)
47
50
  Object.const_set(const_name, original_const_value) if original_const_defined
48
51
  end
49
-
50
- @example_group.with_table(table_name, @table_options, &@table_block)
51
52
  end
52
53
  end
53
54
  end
@@ -1,3 +1,3 @@
1
1
  module WithModel
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
data/spec/spec.opts ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format nested
data/spec/spec_helper.rb CHANGED
@@ -41,3 +41,8 @@ if defined?(ActiveModel)
41
41
  before { @model = subject }
42
42
  end
43
43
  end
44
+
45
+ if ENV["LOGGER"]
46
+ require "logger"
47
+ ActiveRecord::Base.logger = Logger.new(STDOUT)
48
+ end
@@ -239,6 +239,7 @@ describe "a temporary ActiveRecord model created with with_model" do
239
239
  end
240
240
 
241
241
  it "should act like a normal ActiveRecord model" do
242
+ BlogPost.columns.map(&:name).should == ["id"]
242
243
  record = BlogPost.create!
243
244
  record.reload
244
245
  record.destroy
data/with_model.gemspec CHANGED
@@ -18,4 +18,5 @@ Gem::Specification.new do |s|
18
18
  s.require_paths = ["lib"]
19
19
 
20
20
  s.add_dependency 'activerecord', '>=2.3.5', '<4.0.0'
21
+ s.add_dependency 'rspec', "<3"
21
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: with_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2011-09-02 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
17
- requirement: &70182266155180 !ruby/object:Gem::Requirement
17
+ requirement: &2168918400 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -25,7 +25,18 @@ dependencies:
25
25
  version: 4.0.0
26
26
  type: :runtime
27
27
  prerelease: false
28
- version_requirements: *70182266155180
28
+ version_requirements: *2168918400
29
+ - !ruby/object:Gem::Dependency
30
+ name: rspec
31
+ requirement: &2168917640 !ruby/object:Gem::Requirement
32
+ none: false
33
+ requirements:
34
+ - - <
35
+ - !ruby/object:Gem::Version
36
+ version: '3'
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: *2168917640
29
40
  description: Dynamically build a model within an Rspec context
30
41
  email:
31
42
  - casecommons-dev@googlegroups.com
@@ -51,6 +62,7 @@ files:
51
62
  - lib/with_model/version.rb
52
63
  - spec/active_record_behaviors_spec.rb
53
64
  - spec/readme_spec.rb
65
+ - spec/spec.opts
54
66
  - spec/spec_helper.rb
55
67
  - spec/with_model_spec.rb
56
68
  - with_model.gemspec
@@ -81,5 +93,6 @@ summary: Dynamically build a model within an Rspec context
81
93
  test_files:
82
94
  - spec/active_record_behaviors_spec.rb
83
95
  - spec/readme_spec.rb
96
+ - spec/spec.opts
84
97
  - spec/spec_helper.rb
85
98
  - spec/with_model_spec.rb