memory_test_fix 1.3.0 → 1.4.0

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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +5 -0
  3. data/README.md +14 -7
  4. data/Rakefile +7 -0
  5. data/fixtures/rails50_app/Gemfile +10 -0
  6. data/fixtures/{rails42_app → rails50_app}/Rakefile +1 -1
  7. data/fixtures/rails50_app/app/models/application_record.rb +3 -0
  8. data/fixtures/rails50_app/app/models/foo.rb +2 -0
  9. data/fixtures/rails50_app/bin/rake +9 -0
  10. data/fixtures/rails50_app/bin/spring +15 -0
  11. data/fixtures/{rails42_app → rails50_app}/config/application.rb +1 -1
  12. data/fixtures/rails50_app/config/boot.rb +3 -0
  13. data/fixtures/{rails41_app → rails50_app}/config/environment.rb +1 -1
  14. data/fixtures/{rails41_app → rails50_app}/config/environments/development.rb +0 -0
  15. data/fixtures/{rails41_app → rails50_app}/config/environments/production.rb +0 -0
  16. data/fixtures/{rails42_app → rails50_app}/config/environments/test.rb +0 -0
  17. data/fixtures/{rails41_app → rails50_app}/config/initializers/filter_parameter_logging.rb +0 -0
  18. data/fixtures/{rails42_app → rails50_app}/db/migrate/20140830065127_create_foos.rb +0 -0
  19. data/fixtures/{rails42_app → rails50_app}/db/schema.rb +0 -0
  20. data/fixtures/{rails40_app → rails50_app}/test/fixtures/foos.yml +0 -0
  21. data/fixtures/{rails42_app → rails50_app}/test/test_helper.rb +0 -0
  22. data/fixtures/{rails40_app → rails50_app}/test/unit/foo_test.rb +0 -0
  23. data/lib/memory_test_fix/schema_loader.rb +12 -2
  24. data/memory_test_fix.gemspec +4 -4
  25. data/spec/unit/memory_test_fix/schema_loader_spec.rb +34 -4
  26. data/test/integration/integration_test.rb +25 -21
  27. metadata +31 -70
  28. data/fixtures/rails40_app/Gemfile +0 -5
  29. data/fixtures/rails40_app/Rakefile +0 -6
  30. data/fixtures/rails40_app/app/models/foo.rb +0 -2
  31. data/fixtures/rails40_app/config/application.rb +0 -14
  32. data/fixtures/rails40_app/config/boot.rb +0 -4
  33. data/fixtures/rails40_app/config/environment.rb +0 -5
  34. data/fixtures/rails40_app/config/environments/test.rb +0 -3
  35. data/fixtures/rails40_app/db/migrate/20140830065127_create_foos.rb +0 -13
  36. data/fixtures/rails40_app/db/schema.rb +0 -22
  37. data/fixtures/rails40_app/test/test_helper.rb +0 -13
  38. data/fixtures/rails41_app/Gemfile +0 -5
  39. data/fixtures/rails41_app/Rakefile +0 -6
  40. data/fixtures/rails41_app/app/models/foo.rb +0 -2
  41. data/fixtures/rails41_app/config/application.rb +0 -12
  42. data/fixtures/rails41_app/config/boot.rb +0 -4
  43. data/fixtures/rails41_app/config/environments/test.rb +0 -4
  44. data/fixtures/rails41_app/db/migrate/20140830065127_create_foos.rb +0 -13
  45. data/fixtures/rails41_app/db/schema.rb +0 -22
  46. data/fixtures/rails41_app/test/fixtures/foos.yml +0 -7
  47. data/fixtures/rails41_app/test/test_helper.rb +0 -13
  48. data/fixtures/rails41_app/test/unit/foo_test.rb +0 -13
  49. data/fixtures/rails42_app/Gemfile +0 -9
  50. data/fixtures/rails42_app/app/models/foo.rb +0 -2
  51. data/fixtures/rails42_app/bin/rake +0 -8
  52. data/fixtures/rails42_app/bin/spring +0 -15
  53. data/fixtures/rails42_app/config/boot.rb +0 -3
  54. data/fixtures/rails42_app/config/environment.rb +0 -5
  55. data/fixtures/rails42_app/config/environments/development.rb +0 -3
  56. data/fixtures/rails42_app/config/environments/production.rb +0 -3
  57. data/fixtures/rails42_app/config/initializers/filter_parameter_logging.rb +0 -1
  58. data/fixtures/rails42_app/test/fixtures/foos.yml +0 -7
  59. 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: 252c0ff8d21e91bac9b707e0bd0ff6ab9ecde051
4
- data.tar.gz: c1b83cc9680a2665b5083dbd2e8e860881ed0bec
3
+ metadata.gz: 7c1ac2b08993a2e58f8fe0409fb361f11886c8d9
4
+ data.tar.gz: b364bf2e116b46310e9b6a3c722f4a71c84c26e3
5
5
  SHA512:
6
- metadata.gz: 164c1dc344d34eb5e08196dda871bcebdf50ef02f2bd15e9e64ace618694a0d8875775948477b1271381613501a127128404ea7f8030847db724c233a769b0a9
7
- data.tar.gz: ce6eb129ccc64d38c679080cafe86381afde8852b8a493db98cf17bfe2d5db7821a2fd7a9352ad11ffdd301d9f4e86a9cf33befd356a457844e43a7dbdafe96c
6
+ metadata.gz: 1e69101d6fe28da09d08be1a0173aa22919c6b0a1a8f40d4bdd2834bff05864aac1f9a5506deb6ba5474725a344b7a21ec55e45725888cdb8f9800987f56f6c6
7
+ data.tar.gz: d62240d757c605c18fefae7d8c47da6d47ce2db6ab12e658218e47aea240d953c19c548dd4dfc639bdadb180bb41e6b84e1de1077039b6c2792f3b6eb8255183
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.0 / 2016-07-06
4
+
5
+ * Add support for Rails 5.0
6
+ * Drop support for Rails 4.x
7
+
3
8
  ## 1.3.0 / 2015-09-07
4
9
 
5
10
  * Drop support for Rails 3.2
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
- This gem is compatible with Rails 4. If you're using an older version of Rails,
48
- your first priority should be upgrading Rails. If that's not an option, you can
49
- use version 1.2.2 of this gem with Rails 3.2. If you're using Rails 3.1 or 3.0,
50
- use version 1.1.0 of this gem. If you're using Rails 2.3, use version 0.2.2. If
51
- you're using an even older version of Rails, use version 0.1.3.
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
@@ -0,0 +1,10 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 5.0.0'
4
+ gem 'sqlite3', platform: :ruby
5
+ gem 'activerecord-jdbcsqlite3-adapter', platform: :jruby
6
+ gem 'memory_test_fix', path: '../..'
7
+
8
+ group :development, :test do
9
+ gem 'spring'
10
+ end
@@ -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
- require File.expand_path('../config/application', __FILE__)
4
+ require_relative 'config/application'
5
5
 
6
6
  Rails.application.load_tasks
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -0,0 +1,2 @@
1
+ class Foo < ApplicationRecord
2
+ end
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ require_relative '../config/boot'
8
+ require 'rake'
9
+ Rake.application.run
@@ -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
@@ -1,4 +1,4 @@
1
- require File.expand_path('../boot', __FILE__)
1
+ require_relative 'boot'
2
2
 
3
3
  require 'rails'
4
4
  require 'active_record/railtie'
@@ -0,0 +1,3 @@
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2
+
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -1,5 +1,5 @@
1
1
  # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
2
+ require_relative 'application'
3
3
 
4
4
  # Initialize the Rails application.
5
5
  Rails.application.initialize!
@@ -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
- silence_stream STDOUT do
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "memory_test_fix"
3
- spec.version = "1.3.0"
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", ">= 4.0.0", "< 4.99.0")
33
- spec.add_runtime_dependency("activerecord", ">= 4.0.0", "< 4.99.0")
34
- spec.add_development_dependency("rake", "~> 10.2")
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("Creating sqlite :memory: database\n").to_stdout
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
- silence_stream(STDOUT) { schema_loader.init_schema }
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
- silence_stream(STDOUT) { schema_loader.init_schema }
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 4.0", 'rails40_app', false],
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, binstubs|
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
- if binstubs
85
- describe 'when using spring' do
86
- let(:command_array) { %w(bin/rake) }
87
- it "can run its tests in-memory without migrations" do
88
- Dir.chdir "fixtures/#{appdir}" do
89
- create_db_config_without_migrations
90
- out = run_tests command_array
91
- out.must_match(/Creating sqlite :memory: database/)
92
- out.must_match(/initialize_schema_migrations_table/)
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
- it "can run its tests in-memory with migrations" do
97
- Dir.chdir "fixtures/#{appdir}" do
98
- create_db_config_with_migrations
99
- out = run_tests command_array
100
- out.must_match(/Creating sqlite :memory: database/)
101
- out.wont_match(/initialize_schema_migrations_table/)
102
- end
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.3.0
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: 2015-09-07 00:00:00.000000000 Z
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: 4.99.0
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: 4.99.0
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: 4.99.0
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: 4.99.0
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: '10.2'
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: '10.2'
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/rails40_app/Gemfile
115
- - fixtures/rails40_app/Rakefile
116
- - fixtures/rails40_app/app/models/foo.rb
117
- - fixtures/rails40_app/config/application.rb
118
- - fixtures/rails40_app/config/boot.rb
119
- - fixtures/rails40_app/config/environment.rb
120
- - fixtures/rails40_app/config/environments/test.rb
121
- - fixtures/rails40_app/db/migrate/20140830065127_create_foos.rb
122
- - fixtures/rails40_app/db/schema.rb
123
- - fixtures/rails40_app/test/fixtures/foos.yml
124
- - fixtures/rails40_app/test/test_helper.rb
125
- - fixtures/rails40_app/test/unit/foo_test.rb
126
- - fixtures/rails41_app/Gemfile
127
- - fixtures/rails41_app/Rakefile
128
- - fixtures/rails41_app/app/models/foo.rb
129
- - fixtures/rails41_app/config/application.rb
130
- - fixtures/rails41_app/config/boot.rb
131
- - fixtures/rails41_app/config/environment.rb
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.4.5.1
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,5 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'rails', '~> 4.0.0'
4
- gem 'sqlite3'
5
- gem 'memory_test_fix', path: '../..'
@@ -1,6 +0,0 @@
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
- Rails40App::Application.load_tasks
@@ -1,2 +0,0 @@
1
- class Foo < ActiveRecord::Base
2
- end
@@ -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,4 +0,0 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
-
4
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -1,5 +0,0 @@
1
- # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the Rails application.
5
- Rails40App::Application.initialize!
@@ -1,3 +0,0 @@
1
- Rails40App::Application.configure do
2
- config.active_support.deprecation = :stderr
3
- end
@@ -1,13 +0,0 @@
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
@@ -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,5 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'rails', '~> 4.1.0'
4
- gem 'sqlite3'
5
- gem 'memory_test_fix', path: '../..'
@@ -1,6 +0,0 @@
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
@@ -1,2 +0,0 @@
1
- class Foo < ActiveRecord::Base
2
- end
@@ -1,12 +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(*Rails.groups)
8
-
9
- module Rails41App
10
- class Application < Rails::Application
11
- end
12
- end
@@ -1,4 +0,0 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
-
4
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
@@ -1,4 +0,0 @@
1
- Rails.application.configure do
2
- config.eager_load = false
3
- config.active_support.deprecation = :stderr
4
- end
@@ -1,13 +0,0 @@
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
@@ -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,7 +0,0 @@
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
@@ -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,9 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rails', '~> 4.2.0'
4
- gem 'sqlite3'
5
- gem 'memory_test_fix', path: '../..'
6
-
7
- group :development, :test do
8
- gem 'spring'
9
- end
@@ -1,2 +0,0 @@
1
- class Foo < ActiveRecord::Base
2
- end
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
- begin
3
- load File.expand_path("../spring", __FILE__)
4
- rescue LoadError
5
- end
6
- require_relative '../config/boot'
7
- require 'rake'
8
- Rake.application.run
@@ -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,3 +0,0 @@
1
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2
-
3
- require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -1,5 +0,0 @@
1
- # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the Rails application.
5
- Rails.application.initialize!
@@ -1,3 +0,0 @@
1
- Rails.application.configure do
2
- config.eager_load = false
3
- end
@@ -1,3 +0,0 @@
1
- Rails.application.configure do
2
- config.eager_load = true
3
- end
@@ -1 +0,0 @@
1
- Rails.application.config.filter_parameters += [:password]
@@ -1,7 +0,0 @@
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
@@ -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