memory_test_fix 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1a0498adafb593f01fc7779ae027d3b4309c383
4
- data.tar.gz: db098470d01fd6bd391e93fcc8aa1803fa8f8c9e
3
+ metadata.gz: 9edd3156a490243468c8f7cc900f0f78ef05cbe4
4
+ data.tar.gz: 0ca43175ce12f05cc8ade8c63eebf4a496acc44f
5
5
  SHA512:
6
- metadata.gz: a713a7fba6890b281d9bf79619b963c6b4dbf7bda0983dbde290e299b6a515dc425457b038011b514084faa69fdc802c5a0f1c650ae5c15657896d037cae7baf
7
- data.tar.gz: 8f30a51999e7549171346cff5b9108961c299e35e5d0fcd750d83b19ae6954717e59a747e9e3a275274bad3081845e657dc5bca624a6b1e3e0ce89bb445d2db4
6
+ metadata.gz: 0490f360784f09d80c3276ba47696011ec4b894bcf297e03a493bba0fd9c8c4a7bd4478e348d165389eb4e2b7d5cd7fa0fbf082a38e7f5f9d82bce9f8c40df9d
7
+ data.tar.gz: fd54cfd80904a988b68b5ef0421cc90f163d70f8c558e9308a30c4d18f53f59f5194e52a46d0666cd97d818734eb42f55b968e58eabcec8d9798ac470e0b080a
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.2 / 2014-09-09
4
+
5
+ * Make dependency declaration match set of supported Rails versions
6
+ * Document public API
7
+ * Add integration test for upcoming Rails 4.2
8
+
3
9
  ## 1.2.1 / 2014-09-07
4
10
 
5
11
  * Ensure all files are available in the gem
data/README.md CHANGED
@@ -35,12 +35,10 @@ You can also adjust the verbosity of the output:
35
35
 
36
36
  To use rails migrations instead of loading `db/schema.rb`
37
37
 
38
- ```yaml
39
- test:
40
- adapter: sqlite3
41
- database: ":memory:"
42
- migrate: true
43
- ```
38
+ test:
39
+ adapter: sqlite3
40
+ database: ":memory:"
41
+ migrate: true
44
42
 
45
43
  You can also use this with other (testing) environments, not just 'test'.
46
44
 
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 4.2.0.beta1'
4
+ gem 'sqlite3'
5
+ gem 'memory_test_fix', path: '../..'
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,2 @@
1
+ class Foo < ActiveRecord::Base
2
+ end
@@ -0,0 +1,12 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails'
4
+ require 'active_record/railtie'
5
+ require 'rails/test_unit/railtie'
6
+
7
+ Bundler.require(*Rails.groups)
8
+
9
+ module RailsTestApp
10
+ class Application < Rails::Application
11
+ end
12
+ end
@@ -0,0 +1,3 @@
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2
+
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,3 @@
1
+ Rails.application.configure do
2
+ config.eager_load = false
3
+ end
@@ -0,0 +1,3 @@
1
+ Rails.application.configure do
2
+ config.eager_load = true
3
+ end
@@ -0,0 +1,4 @@
1
+ Rails.application.configure do
2
+ config.eager_load = false
3
+ config.active_support.deprecation = :stderr
4
+ end
@@ -0,0 +1 @@
1
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,13 @@
1
+ class CreateFoos < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :foos do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+
10
+ def self.down
11
+ drop_table :foos
12
+ end
13
+ end
@@ -0,0 +1,22 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20140830065127) do
15
+
16
+ create_table "foos", force: true do |t|
17
+ t.string "name", limit: 255
18
+ t.datetime "created_at"
19
+ t.datetime "updated_at"
20
+ end
21
+
22
+ end
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ one:
4
+ name: Foo one
5
+
6
+ two:
7
+ name: Foo two
@@ -0,0 +1,10 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+ require File.expand_path('../../config/environment', __FILE__)
3
+ require 'rails/test_help'
4
+
5
+ class ActiveSupport::TestCase
6
+ # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
7
+ fixtures :all
8
+
9
+ # Add more helper methods to be used by all tests here...
10
+ end
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ class FooTest < ActiveSupport::TestCase
4
+ test "Foos have names" do
5
+ assert_equal 'Foo one', foos(:one).name
6
+ end
7
+
8
+ test "Foos can be stored" do
9
+ foo = Foo.new(name: 'A third')
10
+ foo.save!
11
+ assert_equal 'A third', Foo.find(foo.id).name
12
+ end
13
+ end
@@ -1,6 +1,8 @@
1
1
  module MemoryTestFix
2
2
  # Load Rails schema file into in-memory database.
3
+ # @api private
3
4
  module SchemaFileLoader
5
+ # Load the Rails schema file.
4
6
  def self.load_schema
5
7
  # TODO: Use tooling provided by rails once support for Rails 3 is dropped.
6
8
  load "#{Rails.root}/db/schema.rb"
@@ -4,16 +4,27 @@ require 'active_support/core_ext/kernel/reporting'
4
4
  module MemoryTestFix
5
5
  # Set up database schema into in-memory database.
6
6
  class SchemaLoader
7
+ # Initialize the schema for an in-memory database, if it is configured. See
8
+ # the README for details on how to configure Rails to use an in-memory
9
+ # database.
7
10
  def self.init_schema
8
11
  new.init_schema
9
12
  end
10
13
 
14
+ # @param [Hash] options The options to configure this instance of SchemaLoader with.
15
+ # @option options [Hash] :configuration The configuration of the database connection
16
+ # @option options :migrator The migrator to use if configured to use migrations
17
+ # @option options :loader The loader to use if configured to not use migrations
18
+ # @api private
11
19
  def initialize(options = {})
12
20
  @configuration = options[:configuration] || ActiveRecord::Base.connection_config
13
21
  @migrator = options[:migrator] || ActiveRecord::Migrator
14
22
  @loader = options[:loader] || SchemaFileLoader
15
23
  end
16
24
 
25
+ # Initialize the schema for the in-memoray database according to the
26
+ # configuration passed to the constructor.
27
+ # @api private
17
28
  def init_schema
18
29
  return unless in_memory_database?
19
30
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "memory_test_fix"
3
- spec.version = "1.2.1"
3
+ spec.version = "1.2.2"
4
4
 
5
5
  spec.authors = ["Matijs van Zuijlen",
6
6
  "Chris Roos",
@@ -29,9 +29,9 @@ Gem::Specification.new do |spec|
29
29
  spec.rdoc_options = ["--main", "README.md"]
30
30
  spec.extra_rdoc_files = ["README.md"]
31
31
 
32
- spec.add_runtime_dependency("railties", ">= 3.0.0")
33
- spec.add_runtime_dependency("activerecord", ">= 3.0.0")
32
+ spec.add_runtime_dependency("railties", ">= 3.2.0", "< 4.99.0")
33
+ spec.add_runtime_dependency("activerecord", ">= 3.2.0", "< 4.99.0")
34
34
  spec.add_development_dependency("rake", "~> 10.2")
35
35
  spec.add_development_dependency("minitest", "~> 5.2")
36
- spec.add_development_dependency("rspec", "~> 3.1.0")
36
+ spec.add_development_dependency("rspec", "~> 3.1")
37
37
  end
@@ -51,6 +51,7 @@ VERSIONS = [
51
51
  ["Rails 3.2", 'rails32_app'],
52
52
  ["Rails 4.0", 'rails40_app'],
53
53
  ["Rails 4.1", 'rails41_app'],
54
+ ["Rails 4.2", 'rails42_app'],
54
55
  ]
55
56
 
56
57
  VERSIONS.each do |label, appdir|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memory_test_fix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matijs van Zuijlen
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2014-09-07 00:00:00.000000000 Z
17
+ date: 2014-09-09 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: railties
@@ -22,28 +22,40 @@ dependencies:
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: 3.0.0
25
+ version: 3.2.0
26
+ - - "<"
27
+ - !ruby/object:Gem::Version
28
+ version: 4.99.0
26
29
  type: :runtime
27
30
  prerelease: false
28
31
  version_requirements: !ruby/object:Gem::Requirement
29
32
  requirements:
30
33
  - - ">="
31
34
  - !ruby/object:Gem::Version
32
- version: 3.0.0
35
+ version: 3.2.0
36
+ - - "<"
37
+ - !ruby/object:Gem::Version
38
+ version: 4.99.0
33
39
  - !ruby/object:Gem::Dependency
34
40
  name: activerecord
35
41
  requirement: !ruby/object:Gem::Requirement
36
42
  requirements:
37
43
  - - ">="
38
44
  - !ruby/object:Gem::Version
39
- version: 3.0.0
45
+ version: 3.2.0
46
+ - - "<"
47
+ - !ruby/object:Gem::Version
48
+ version: 4.99.0
40
49
  type: :runtime
41
50
  prerelease: false
42
51
  version_requirements: !ruby/object:Gem::Requirement
43
52
  requirements:
44
53
  - - ">="
45
54
  - !ruby/object:Gem::Version
46
- version: 3.0.0
55
+ version: 3.2.0
56
+ - - "<"
57
+ - !ruby/object:Gem::Version
58
+ version: 4.99.0
47
59
  - !ruby/object:Gem::Dependency
48
60
  name: rake
49
61
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +90,14 @@ dependencies:
78
90
  requirements:
79
91
  - - "~>"
80
92
  - !ruby/object:Gem::Version
81
- version: 3.1.0
93
+ version: '3.1'
82
94
  type: :development
83
95
  prerelease: false
84
96
  version_requirements: !ruby/object:Gem::Requirement
85
97
  requirements:
86
98
  - - "~>"
87
99
  - !ruby/object:Gem::Version
88
- version: 3.1.0
100
+ version: '3.1'
89
101
  description: |2
90
102
  Makes use of SQLite3 in-memory database possible for your
91
103
  Rails tests by preloading the schema.
@@ -139,6 +151,21 @@ files:
139
151
  - fixtures/rails41_app/test/fixtures/foos.yml
140
152
  - fixtures/rails41_app/test/test_helper.rb
141
153
  - fixtures/rails41_app/test/unit/foo_test.rb
154
+ - fixtures/rails42_app/Gemfile
155
+ - fixtures/rails42_app/Rakefile
156
+ - fixtures/rails42_app/app/models/foo.rb
157
+ - fixtures/rails42_app/config/application.rb
158
+ - fixtures/rails42_app/config/boot.rb
159
+ - fixtures/rails42_app/config/environment.rb
160
+ - fixtures/rails42_app/config/environments/development.rb
161
+ - fixtures/rails42_app/config/environments/production.rb
162
+ - fixtures/rails42_app/config/environments/test.rb
163
+ - fixtures/rails42_app/config/initializers/filter_parameter_logging.rb
164
+ - fixtures/rails42_app/db/migrate/20140830065127_create_foos.rb
165
+ - fixtures/rails42_app/db/schema.rb
166
+ - fixtures/rails42_app/test/fixtures/foos.yml
167
+ - fixtures/rails42_app/test/test_helper.rb
168
+ - fixtures/rails42_app/test/unit/foo_test.rb
142
169
  - lib/memory_test_fix.rb
143
170
  - lib/memory_test_fix/railtie.rb
144
171
  - lib/memory_test_fix/schema_file_loader.rb