memory_test_fix 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +5 -0
- data/README.md +14 -7
- data/Rakefile +7 -0
- data/fixtures/rails50_app/Gemfile +10 -0
- data/fixtures/{rails42_app → rails50_app}/Rakefile +1 -1
- data/fixtures/rails50_app/app/models/application_record.rb +3 -0
- data/fixtures/rails50_app/app/models/foo.rb +2 -0
- data/fixtures/rails50_app/bin/rake +9 -0
- data/fixtures/rails50_app/bin/spring +15 -0
- data/fixtures/{rails42_app → rails50_app}/config/application.rb +1 -1
- data/fixtures/rails50_app/config/boot.rb +3 -0
- data/fixtures/{rails41_app → rails50_app}/config/environment.rb +1 -1
- data/fixtures/{rails41_app → rails50_app}/config/environments/development.rb +0 -0
- data/fixtures/{rails41_app → rails50_app}/config/environments/production.rb +0 -0
- data/fixtures/{rails42_app → rails50_app}/config/environments/test.rb +0 -0
- data/fixtures/{rails41_app → rails50_app}/config/initializers/filter_parameter_logging.rb +0 -0
- data/fixtures/{rails42_app → rails50_app}/db/migrate/20140830065127_create_foos.rb +0 -0
- data/fixtures/{rails42_app → rails50_app}/db/schema.rb +0 -0
- data/fixtures/{rails40_app → rails50_app}/test/fixtures/foos.yml +0 -0
- data/fixtures/{rails42_app → rails50_app}/test/test_helper.rb +0 -0
- data/fixtures/{rails40_app → rails50_app}/test/unit/foo_test.rb +0 -0
- data/lib/memory_test_fix/schema_loader.rb +12 -2
- data/memory_test_fix.gemspec +4 -4
- data/spec/unit/memory_test_fix/schema_loader_spec.rb +34 -4
- data/test/integration/integration_test.rb +25 -21
- metadata +31 -70
- data/fixtures/rails40_app/Gemfile +0 -5
- data/fixtures/rails40_app/Rakefile +0 -6
- data/fixtures/rails40_app/app/models/foo.rb +0 -2
- data/fixtures/rails40_app/config/application.rb +0 -14
- data/fixtures/rails40_app/config/boot.rb +0 -4
- data/fixtures/rails40_app/config/environment.rb +0 -5
- data/fixtures/rails40_app/config/environments/test.rb +0 -3
- data/fixtures/rails40_app/db/migrate/20140830065127_create_foos.rb +0 -13
- data/fixtures/rails40_app/db/schema.rb +0 -22
- data/fixtures/rails40_app/test/test_helper.rb +0 -13
- data/fixtures/rails41_app/Gemfile +0 -5
- data/fixtures/rails41_app/Rakefile +0 -6
- data/fixtures/rails41_app/app/models/foo.rb +0 -2
- data/fixtures/rails41_app/config/application.rb +0 -12
- data/fixtures/rails41_app/config/boot.rb +0 -4
- data/fixtures/rails41_app/config/environments/test.rb +0 -4
- data/fixtures/rails41_app/db/migrate/20140830065127_create_foos.rb +0 -13
- data/fixtures/rails41_app/db/schema.rb +0 -22
- data/fixtures/rails41_app/test/fixtures/foos.yml +0 -7
- data/fixtures/rails41_app/test/test_helper.rb +0 -13
- data/fixtures/rails41_app/test/unit/foo_test.rb +0 -13
- data/fixtures/rails42_app/Gemfile +0 -9
- data/fixtures/rails42_app/app/models/foo.rb +0 -2
- data/fixtures/rails42_app/bin/rake +0 -8
- data/fixtures/rails42_app/bin/spring +0 -15
- data/fixtures/rails42_app/config/boot.rb +0 -3
- data/fixtures/rails42_app/config/environment.rb +0 -5
- data/fixtures/rails42_app/config/environments/development.rb +0 -3
- data/fixtures/rails42_app/config/environments/production.rb +0 -3
- data/fixtures/rails42_app/config/initializers/filter_parameter_logging.rb +0 -1
- data/fixtures/rails42_app/test/fixtures/foos.yml +0 -7
- data/fixtures/rails42_app/test/unit/foo_test.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c1ac2b08993a2e58f8fe0409fb361f11886c8d9
|
4
|
+
data.tar.gz: b364bf2e116b46310e9b6a3c722f4a71c84c26e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e69101d6fe28da09d08be1a0173aa22919c6b0a1a8f40d4bdd2834bff05864aac1f9a5506deb6ba5474725a344b7a21ec55e45725888cdb8f9800987f56f6c6
|
7
|
+
data.tar.gz: d62240d757c605c18fefae7d8c47da6d47ce2db6ab12e658218e47aea240d953c19c548dd4dfc639bdadb180bb41e6b84e1de1077039b6c2792f3b6eb8255183
|
data/Changelog.md
CHANGED
data/README.md
CHANGED
@@ -15,8 +15,7 @@ Add the gem to your bundle by adding
|
|
15
15
|
|
16
16
|
gem 'memory_test_fix'
|
17
17
|
|
18
|
-
to your `Gemfile
|
19
|
-
|
18
|
+
to your `Gemfile`.
|
20
19
|
|
21
20
|
In your database.yml, use:
|
22
21
|
|
@@ -44,11 +43,19 @@ You can also use this with other (testing) environments, not just 'test'.
|
|
44
43
|
|
45
44
|
## Rails Versions
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
you're
|
46
|
+
In general, Bundler should pick a compatible version for you if you don't
|
47
|
+
specify one in your `Gemfile`.
|
48
|
+
|
49
|
+
That said, the latest version of this gem is compatible with Rails 5.0.
|
50
|
+
If you're still on Rails 4, you can use version 1.3.0. Unfortunately, the hard
|
51
|
+
requirement of Ruby 2.2 or above for Rails 5 means `memory_test_fix` cannot
|
52
|
+
support Rails 4 and 5 at the same time.
|
53
|
+
|
54
|
+
If you're using a version of Rails older than 4, your first priority should be
|
55
|
+
upgrading Rails. If that's really not an option, you can use version 1.2.2 of
|
56
|
+
this gem with Rails 3.2. If you're using Rails 3.1 or 3.0, use version 1.1.0.
|
57
|
+
If you're using Rails 2.3, use version 0.2.2. If you're using an even older
|
58
|
+
version of Rails, use version 0.1.3.
|
52
59
|
|
53
60
|
## Authors
|
54
61
|
|
data/Rakefile
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
require 'rake'
|
2
2
|
require 'rake/testtask'
|
3
3
|
require 'rspec/core/rake_task'
|
4
|
+
require 'bundler/gem_tasks'
|
5
|
+
require 'rake/clean'
|
6
|
+
|
7
|
+
CLEAN.include 'fixtures/**/Gemfile.lock'
|
8
|
+
CLOBBER.include 'pkg'
|
9
|
+
|
10
|
+
Bundler::GemHelper.install_tasks
|
4
11
|
|
5
12
|
desc 'Default: run tests.'
|
6
13
|
task default: :test
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
2
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
3
|
|
4
|
-
|
4
|
+
require_relative 'config/application'
|
5
5
|
|
6
6
|
Rails.application.load_tasks
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This file loads spring without using Bundler, in order to be fast.
|
4
|
+
# It gets overwritten when you run the `spring binstub` command.
|
5
|
+
|
6
|
+
unless defined?(Spring)
|
7
|
+
require 'rubygems'
|
8
|
+
require 'bundler'
|
9
|
+
|
10
|
+
if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m))
|
11
|
+
Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) }
|
12
|
+
gem 'spring', match[1]
|
13
|
+
require 'spring/binstub'
|
14
|
+
end
|
15
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'memory_test_fix/schema_file_loader'
|
2
|
-
require 'active_support/core_ext/kernel/reporting'
|
3
2
|
|
4
3
|
module MemoryTestFix
|
5
4
|
# Set up database schema into in-memory database.
|
@@ -80,9 +79,20 @@ module MemoryTestFix
|
|
80
79
|
end
|
81
80
|
|
82
81
|
def load_schema_silently
|
83
|
-
|
82
|
+
silently do
|
84
83
|
load_schema
|
85
84
|
end
|
86
85
|
end
|
86
|
+
|
87
|
+
def silently
|
88
|
+
tmp_stream = StringIO.new
|
89
|
+
|
90
|
+
original = $stdout
|
91
|
+
$stdout = tmp_stream
|
92
|
+
|
93
|
+
yield
|
94
|
+
ensure
|
95
|
+
$stderr = original
|
96
|
+
end
|
87
97
|
end
|
88
98
|
end
|
data/memory_test_fix.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "memory_test_fix"
|
3
|
-
spec.version = "1.
|
3
|
+
spec.version = "1.4.0"
|
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", "
|
33
|
-
spec.add_runtime_dependency("activerecord", "
|
34
|
-
spec.add_development_dependency("rake", "~>
|
32
|
+
spec.add_runtime_dependency("railties", "~> 5.0.0")
|
33
|
+
spec.add_runtime_dependency("activerecord", "~> 5.0.0")
|
34
|
+
spec.add_development_dependency("rake", "~> 11.1")
|
35
35
|
spec.add_development_dependency("minitest", "~> 5.2")
|
36
36
|
spec.add_development_dependency("rspec", "~> 3.1")
|
37
37
|
end
|
@@ -3,6 +3,17 @@ require 'spec_helper'
|
|
3
3
|
require 'memory_test_fix/schema_loader'
|
4
4
|
|
5
5
|
RSpec.describe MemoryTestFix::SchemaLoader do
|
6
|
+
def silently
|
7
|
+
tmp_stream = StringIO.new
|
8
|
+
|
9
|
+
original = $stdout
|
10
|
+
$stdout = tmp_stream
|
11
|
+
|
12
|
+
yield
|
13
|
+
ensure
|
14
|
+
$stderr = original
|
15
|
+
end
|
16
|
+
|
6
17
|
describe '#init_schema' do
|
7
18
|
let(:migrator) { double(:migrator) }
|
8
19
|
let(:loader) { double(:loader) }
|
@@ -10,7 +21,7 @@ RSpec.describe MemoryTestFix::SchemaLoader do
|
|
10
21
|
let(:schema_loader) { MemoryTestFix::SchemaLoader.new options }
|
11
22
|
|
12
23
|
before do
|
13
|
-
allow(loader).to receive(:load_schema)
|
24
|
+
allow(loader).to receive(:load_schema) { puts 'loading schema' }
|
14
25
|
allow(migrator).to receive(:up)
|
15
26
|
end
|
16
27
|
|
@@ -33,11 +44,16 @@ RSpec.describe MemoryTestFix::SchemaLoader do
|
|
33
44
|
|
34
45
|
it "informs the user it is creating an in-memory database" do
|
35
46
|
expect { schema_loader.init_schema }.
|
36
|
-
to output(
|
47
|
+
to output(/Creating sqlite :memory: database/).to_stdout
|
48
|
+
end
|
49
|
+
|
50
|
+
it "prints the output from the loader" do
|
51
|
+
expect { schema_loader.init_schema }.
|
52
|
+
to output(/loading schema/).to_stdout
|
37
53
|
end
|
38
54
|
|
39
55
|
it "tells the loader to load the schema" do
|
40
|
-
|
56
|
+
silently { schema_loader.init_schema }
|
41
57
|
expect(loader).to have_received :load_schema
|
42
58
|
end
|
43
59
|
|
@@ -45,11 +61,25 @@ RSpec.describe MemoryTestFix::SchemaLoader do
|
|
45
61
|
let(:config) { base_config.merge(migrate: true) }
|
46
62
|
|
47
63
|
it "tells the migrator to run the migrations" do
|
48
|
-
|
64
|
+
silently { schema_loader.init_schema }
|
49
65
|
expect(migrator).to have_received :up
|
50
66
|
end
|
51
67
|
end
|
52
68
|
|
69
|
+
context "when running in quietly" do
|
70
|
+
let(:config) { base_config.merge(verbosity: 'quiet') }
|
71
|
+
|
72
|
+
it "informs the user it is creating an in-memory database" do
|
73
|
+
expect { schema_loader.init_schema }.
|
74
|
+
to output(/Creating sqlite :memory: database/).to_stdout
|
75
|
+
end
|
76
|
+
|
77
|
+
it "does not print the output from the loader" do
|
78
|
+
expect { schema_loader.init_schema }.
|
79
|
+
not_to output(/loading schema/).to_stdout
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
53
83
|
context "when running in silence" do
|
54
84
|
let(:config) { base_config.merge(verbosity: 'silent') }
|
55
85
|
|
@@ -22,6 +22,12 @@ def run_tests(command_array = %w(bundle exec rake))
|
|
22
22
|
out
|
23
23
|
end
|
24
24
|
|
25
|
+
def stop_spring
|
26
|
+
capture_subprocess_io do
|
27
|
+
in_clean_bundler_environment(*%w(bin/spring stop))
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
25
31
|
BASE_CONFIG = {
|
26
32
|
"development" => {
|
27
33
|
"adapter" => 'sqlite3',
|
@@ -52,12 +58,10 @@ def create_db_config_with_migrations
|
|
52
58
|
end
|
53
59
|
|
54
60
|
VERSIONS = [
|
55
|
-
["Rails
|
56
|
-
["Rails 4.1", 'rails41_app', false],
|
57
|
-
["Rails 4.2", 'rails42_app', true],
|
61
|
+
["Rails 5.0", 'rails50_app'],
|
58
62
|
]
|
59
63
|
|
60
|
-
VERSIONS.each do |label, appdir
|
64
|
+
VERSIONS.each do |label, appdir|
|
61
65
|
Dir.chdir "fixtures/#{appdir}" do
|
62
66
|
update_bundle label
|
63
67
|
end
|
@@ -81,25 +85,25 @@ VERSIONS.each do |label, appdir, binstubs|
|
|
81
85
|
end
|
82
86
|
end
|
83
87
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
end
|
88
|
+
describe 'when using spring' do
|
89
|
+
let(:command_array) { %w(bin/rake) }
|
90
|
+
it "can run its tests in-memory without migrations" do
|
91
|
+
Dir.chdir "fixtures/#{appdir}" do
|
92
|
+
stop_spring
|
93
|
+
create_db_config_without_migrations
|
94
|
+
out = run_tests command_array
|
95
|
+
out.must_match(/Creating sqlite :memory: database/)
|
96
|
+
out.must_match(/initialize_schema_migrations_table/)
|
94
97
|
end
|
98
|
+
end
|
95
99
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
100
|
+
it "can run its tests in-memory with migrations" do
|
101
|
+
Dir.chdir "fixtures/#{appdir}" do
|
102
|
+
stop_spring
|
103
|
+
create_db_config_with_migrations
|
104
|
+
out = run_tests command_array
|
105
|
+
out.must_match(/Creating sqlite :memory: database/)
|
106
|
+
out.wont_match(/initialize_schema_migrations_table/)
|
103
107
|
end
|
104
108
|
end
|
105
109
|
end
|
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.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matijs van Zuijlen
|
@@ -14,62 +14,50 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
17
|
+
date: 2016-07-06 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: railties
|
21
21
|
requirement: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
|
-
- - "
|
24
|
-
- !ruby/object:Gem::Version
|
25
|
-
version: 4.0.0
|
26
|
-
- - "<"
|
23
|
+
- - "~>"
|
27
24
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
25
|
+
version: 5.0.0
|
29
26
|
type: :runtime
|
30
27
|
prerelease: false
|
31
28
|
version_requirements: !ruby/object:Gem::Requirement
|
32
29
|
requirements:
|
33
|
-
- - "
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: 4.0.0
|
36
|
-
- - "<"
|
30
|
+
- - "~>"
|
37
31
|
- !ruby/object:Gem::Version
|
38
|
-
version:
|
32
|
+
version: 5.0.0
|
39
33
|
- !ruby/object:Gem::Dependency
|
40
34
|
name: activerecord
|
41
35
|
requirement: !ruby/object:Gem::Requirement
|
42
36
|
requirements:
|
43
|
-
- - "
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: 4.0.0
|
46
|
-
- - "<"
|
37
|
+
- - "~>"
|
47
38
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
39
|
+
version: 5.0.0
|
49
40
|
type: :runtime
|
50
41
|
prerelease: false
|
51
42
|
version_requirements: !ruby/object:Gem::Requirement
|
52
43
|
requirements:
|
53
|
-
- - "
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: 4.0.0
|
56
|
-
- - "<"
|
44
|
+
- - "~>"
|
57
45
|
- !ruby/object:Gem::Version
|
58
|
-
version:
|
46
|
+
version: 5.0.0
|
59
47
|
- !ruby/object:Gem::Dependency
|
60
48
|
name: rake
|
61
49
|
requirement: !ruby/object:Gem::Requirement
|
62
50
|
requirements:
|
63
51
|
- - "~>"
|
64
52
|
- !ruby/object:Gem::Version
|
65
|
-
version: '
|
53
|
+
version: '11.1'
|
66
54
|
type: :development
|
67
55
|
prerelease: false
|
68
56
|
version_requirements: !ruby/object:Gem::Requirement
|
69
57
|
requirements:
|
70
58
|
- - "~>"
|
71
59
|
- !ruby/object:Gem::Version
|
72
|
-
version: '
|
60
|
+
version: '11.1'
|
73
61
|
- !ruby/object:Gem::Dependency
|
74
62
|
name: minitest
|
75
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,50 +99,24 @@ files:
|
|
111
99
|
- Gemfile
|
112
100
|
- README.md
|
113
101
|
- Rakefile
|
114
|
-
- fixtures/
|
115
|
-
- fixtures/
|
116
|
-
- fixtures/
|
117
|
-
- fixtures/
|
118
|
-
- fixtures/
|
119
|
-
- fixtures/
|
120
|
-
- fixtures/
|
121
|
-
- fixtures/
|
122
|
-
- fixtures/
|
123
|
-
- fixtures/
|
124
|
-
- fixtures/
|
125
|
-
- fixtures/
|
126
|
-
- fixtures/
|
127
|
-
- fixtures/
|
128
|
-
- fixtures/
|
129
|
-
- fixtures/
|
130
|
-
- fixtures/
|
131
|
-
- fixtures/
|
132
|
-
- fixtures/rails41_app/config/environments/development.rb
|
133
|
-
- fixtures/rails41_app/config/environments/production.rb
|
134
|
-
- fixtures/rails41_app/config/environments/test.rb
|
135
|
-
- fixtures/rails41_app/config/initializers/filter_parameter_logging.rb
|
136
|
-
- fixtures/rails41_app/db/migrate/20140830065127_create_foos.rb
|
137
|
-
- fixtures/rails41_app/db/schema.rb
|
138
|
-
- fixtures/rails41_app/test/fixtures/foos.yml
|
139
|
-
- fixtures/rails41_app/test/test_helper.rb
|
140
|
-
- fixtures/rails41_app/test/unit/foo_test.rb
|
141
|
-
- fixtures/rails42_app/Gemfile
|
142
|
-
- fixtures/rails42_app/Rakefile
|
143
|
-
- fixtures/rails42_app/app/models/foo.rb
|
144
|
-
- fixtures/rails42_app/bin/rake
|
145
|
-
- fixtures/rails42_app/bin/spring
|
146
|
-
- fixtures/rails42_app/config/application.rb
|
147
|
-
- fixtures/rails42_app/config/boot.rb
|
148
|
-
- fixtures/rails42_app/config/environment.rb
|
149
|
-
- fixtures/rails42_app/config/environments/development.rb
|
150
|
-
- fixtures/rails42_app/config/environments/production.rb
|
151
|
-
- fixtures/rails42_app/config/environments/test.rb
|
152
|
-
- fixtures/rails42_app/config/initializers/filter_parameter_logging.rb
|
153
|
-
- fixtures/rails42_app/db/migrate/20140830065127_create_foos.rb
|
154
|
-
- fixtures/rails42_app/db/schema.rb
|
155
|
-
- fixtures/rails42_app/test/fixtures/foos.yml
|
156
|
-
- fixtures/rails42_app/test/test_helper.rb
|
157
|
-
- fixtures/rails42_app/test/unit/foo_test.rb
|
102
|
+
- fixtures/rails50_app/Gemfile
|
103
|
+
- fixtures/rails50_app/Rakefile
|
104
|
+
- fixtures/rails50_app/app/models/application_record.rb
|
105
|
+
- fixtures/rails50_app/app/models/foo.rb
|
106
|
+
- fixtures/rails50_app/bin/rake
|
107
|
+
- fixtures/rails50_app/bin/spring
|
108
|
+
- fixtures/rails50_app/config/application.rb
|
109
|
+
- fixtures/rails50_app/config/boot.rb
|
110
|
+
- fixtures/rails50_app/config/environment.rb
|
111
|
+
- fixtures/rails50_app/config/environments/development.rb
|
112
|
+
- fixtures/rails50_app/config/environments/production.rb
|
113
|
+
- fixtures/rails50_app/config/environments/test.rb
|
114
|
+
- fixtures/rails50_app/config/initializers/filter_parameter_logging.rb
|
115
|
+
- fixtures/rails50_app/db/migrate/20140830065127_create_foos.rb
|
116
|
+
- fixtures/rails50_app/db/schema.rb
|
117
|
+
- fixtures/rails50_app/test/fixtures/foos.yml
|
118
|
+
- fixtures/rails50_app/test/test_helper.rb
|
119
|
+
- fixtures/rails50_app/test/unit/foo_test.rb
|
158
120
|
- lib/memory_test_fix.rb
|
159
121
|
- lib/memory_test_fix/railtie.rb
|
160
122
|
- lib/memory_test_fix/schema_file_loader.rb
|
@@ -186,9 +148,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
148
|
version: '0'
|
187
149
|
requirements: []
|
188
150
|
rubyforge_project:
|
189
|
-
rubygems_version: 2.
|
151
|
+
rubygems_version: 2.5.1
|
190
152
|
signing_key:
|
191
153
|
specification_version: 4
|
192
154
|
summary: Use SQLite3 in-memory database for Rails tests.
|
193
155
|
test_files: []
|
194
|
-
has_rdoc:
|
@@ -1,14 +0,0 @@
|
|
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(:default, Rails.env) if defined?(Bundler)
|
8
|
-
|
9
|
-
module Rails40App
|
10
|
-
class Application < Rails::Application
|
11
|
-
config.encoding = "utf-8"
|
12
|
-
config.filter_parameters += [:password, :ssn]
|
13
|
-
end
|
14
|
-
end
|
@@ -1,22 +0,0 @@
|
|
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"
|
18
|
-
t.datetime "created_at"
|
19
|
-
t.datetime "updated_at"
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
@@ -1,13 +0,0 @@
|
|
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|csv) for all tests in alphabetical order.
|
7
|
-
#
|
8
|
-
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
9
|
-
# -- they do not yet inherit this setting
|
10
|
-
fixtures :all
|
11
|
-
|
12
|
-
# Add more helper methods to be used by all tests here...
|
13
|
-
end
|
@@ -1,22 +0,0 @@
|
|
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"
|
18
|
-
t.datetime "created_at"
|
19
|
-
t.datetime "updated_at"
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
@@ -1,13 +0,0 @@
|
|
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
|
-
#
|
8
|
-
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
9
|
-
# -- they do not yet inherit this setting
|
10
|
-
fixtures :all
|
11
|
-
|
12
|
-
# Add more helper methods to be used by all tests here...
|
13
|
-
end
|
@@ -1,13 +0,0 @@
|
|
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,15 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# This file loads spring without using Bundler, in order to be fast.
|
4
|
-
# It gets overwritten when you run the `spring binstub` command.
|
5
|
-
|
6
|
-
unless defined?(Spring)
|
7
|
-
require "rubygems"
|
8
|
-
require "bundler"
|
9
|
-
|
10
|
-
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
|
11
|
-
Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq }
|
12
|
-
gem "spring", match[1]
|
13
|
-
require "spring/binstub"
|
14
|
-
end
|
15
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
Rails.application.config.filter_parameters += [:password]
|
@@ -1,13 +0,0 @@
|
|
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
|