with_model 2.1.5 → 2.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a685dd2fcd809ce446e7dfde25b4fea90014e6bf5456d99e939f79b2ff3b18af
4
- data.tar.gz: 3966fbcbeae1bd24fbeacf1f4c53b67abd78b771e03de3f6263a989ad8e180ce
3
+ metadata.gz: b6da93806455c916606077722ee10e9e5f0fd4ec785471288d210949b3891507
4
+ data.tar.gz: dad3a97b161ccb4d1256402eb7ebffd6746db155094dbd2341e2d860428f9437
5
5
  SHA512:
6
- metadata.gz: 659fff704f44481540e91d6ebe00322dd07fec0beda3142bc2581ed02bc962b7384dacf871a43c5231cc93757a428ef857f2ea093e8b82fb0ee0b9603932793f
7
- data.tar.gz: 588cb797971b7dc861aa207a09cbddebf69c356878993d0edf98458afb83affb0cc2d5d26856a079e8bef4ae5d420698e9f65abcb636ee8990ab6178479467d2
6
+ metadata.gz: 4f83311c48f5472bd2e3f0d00ddb58fedd14de54d483c06ac1594fdfb26c7344174eb92e3dd28593a4b99b582b5872f3a92941a681a2116e244625f18fa4759d
7
+ data.tar.gz: fc9044c0f5e92d9ec0351d3ce912df3cdc3bc4aeddb238ec7d1258f6e63620c3caaaaa65ebf79ce639c2fa9aea2dcb44b098fa57b421d96483e825ad047ae57f
@@ -0,0 +1,61 @@
1
+ name: build
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ - github-actions
8
+ pull_request:
9
+ branches:
10
+ - master
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ env:
16
+ CI: true
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ ruby-version: ['2.6', '2.7', '3.0', '3.1']
21
+ active-record-version-env:
22
+ - ACTIVE_RECORD_VERSION="~> 5.2.0"
23
+ - ACTIVE_RECORD_VERSION="~> 6.0.0"
24
+ - ACTIVE_RECORD_VERSION="~> 6.1.0"
25
+ - ACTIVE_RECORD_VERSION="~> 7.0.0"
26
+ allow-failure: [false]
27
+ include:
28
+ - ruby-version: '3.1'
29
+ active-record-version-env: ACTIVE_RECORD_VERSION="~> 7.0.0"
30
+ allow-failure: true
31
+ - ruby-version: '3.1'
32
+ active-record-version-env: ACTIVE_RECORD_BRANCH="7-0-stable"
33
+ allow-failure: true
34
+ - ruby-version: '3.1'
35
+ active-record-version-env: ACTIVE_RECORD_BRANCH="6-1-stable"
36
+ allow-failure: true
37
+ exclude:
38
+ - ruby-version: '3.0'
39
+ active-record-version-env: ACTIVE_RECORD_VERSION="~> 5.2.0"
40
+ allow-failure: false
41
+ - ruby-version: '3.1'
42
+ active-record-version-env: ACTIVE_RECORD_VERSION="~> 5.2.0"
43
+ allow-failure: false
44
+ - ruby-version: '2.6'
45
+ active-record-version-env: ACTIVE_RECORD_VERSION="~> 7.0.0"
46
+ allow-failure: false
47
+ - ruby-version: '3.1'
48
+ active-record-version-env: ACTIVE_RECORD_VERSION="~> 7.0.0"
49
+ allow-failure: false
50
+ continue-on-error: ${{ matrix.allow-failure }}
51
+ steps:
52
+ - uses: actions/checkout@v2
53
+ - name: Set up Ruby
54
+ uses: ruby/setup-ruby@v1
55
+ with:
56
+ ruby-version: ${{ matrix.ruby-version }}
57
+ bundler-cache: true
58
+ - name: Update bundle
59
+ run: ${{ matrix.active-record-version-env }} bundle update
60
+ - name: Run tests
61
+ run: ${{ matrix.active-record-version-env }} bundle exec rake
data/.rubocop.yml CHANGED
@@ -3,9 +3,11 @@ inherit_from: .rubocop_todo.yml
3
3
  require:
4
4
  - rubocop-rake
5
5
  - rubocop-rspec
6
+ - rubocop-minitest
6
7
 
7
8
  AllCops:
8
9
  NewCops: enable
10
+ TargetRubyVersion: 2.6
9
11
 
10
12
  Metrics/BlockLength:
11
13
  Exclude:
@@ -18,5 +20,11 @@ Bundler/OrderedGems:
18
20
  Bundler/DuplicatedGem:
19
21
  Enabled: false
20
22
 
23
+ RSpec/Be:
24
+ Enabled: false
25
+
26
+ RSpec/BeforeAfterAll:
27
+ Enabled: false
28
+
21
29
  Style/Documentation:
22
30
  Enabled: false
data/.rubocop_todo.yml CHANGED
@@ -6,21 +6,6 @@
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 4
10
- RSpec/Be:
11
- Exclude:
12
- - 'spec/readme_spec.rb'
13
- - 'spec/with_model_spec.rb'
14
-
15
- # Offense count: 3
16
- RSpec/BeforeAfterAll:
17
- Exclude:
18
- - 'spec/spec_helper.rb'
19
- - 'spec/rails_helper.rb'
20
- - 'spec/support/**/*.rb'
21
- - 'spec/readme_spec.rb'
22
- - 'spec/with_model_spec.rb'
23
-
24
9
  # Offense count: 6
25
10
  # Configuration parameters: Prefixes.
26
11
  # Prefixes: when, with, without
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 2.1.6
2
+ - Require Ruby 2.6 or later
3
+ - Add Ruby 3.0 and 3.1 support
4
+ - Add Active Record 6.1 and 7.0 support
5
+ - Add minitest support (Miks Miķelsons)
6
+
1
7
  ### 2.1.5
2
8
 
3
9
  - Add support for Active Record 6.1
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2019 Casebook, PBC <http://www.casebook.net>
1
+ Copyright (c) 2010–2022 Casebook, PBC <http://www.casebook.net>
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # [with_model](https://github.com/Casecommons/with_model)
2
2
 
3
3
  [![Gem Version](https://img.shields.io/gem/v/with_model.svg?style=flat)](https://rubygems.org/gems/with_model)
4
- [![Build Status](https://secure.travis-ci.org/Casecommons/with_model.svg?branch=master)](https://travis-ci.org/Casecommons/with_model)
4
+ [![Build Status](https://github.com/Casecommons/with_model/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Casecommons/with_model/actions/workflows/ci.yml)
5
5
  [![API Documentation](https://img.shields.io/badge/yard-api%20docs-lightgrey.svg)](https://www.rubydoc.info/gems/with_model)
6
6
 
7
7
  `with_model` dynamically builds an Active Record model (with table) before each test in a group and destroys it afterwards.
@@ -12,7 +12,7 @@
12
12
 
13
13
  ## Installation
14
14
 
15
- Install as usual: `gem install with_model` or add `gem 'with_model'` to your Gemfile. See `.travis.yml` for supported (tested) Ruby versions.
15
+ Install as usual: `gem install with_model` or add `gem 'with_model'` to your Gemfile. See [`.github/workflows/ci.yml`](./.github/workflows/ci.yml) for supported (tested) Ruby versions.
16
16
 
17
17
  ### RSpec
18
18
 
@@ -28,11 +28,13 @@ end
28
28
 
29
29
  ### minitest/spec
30
30
 
31
- Extend `WithModel` into minitest/spec:
31
+ Extend `WithModel` into minitest/spec and set the test runner explicitly:
32
32
 
33
33
  ```ruby
34
34
  require 'with_model'
35
35
 
36
+ WithModel.runner = :minitest
37
+
36
38
  class Minitest::Spec
37
39
  extend WithModel
38
40
  end
@@ -181,5 +183,5 @@ In general, `with_model` is not guaranteed to be thread-safe, but is, in certain
181
183
 
182
184
  ## License
183
185
 
184
- Copyright © 2010–2020 [Casebook PBC](https://www.casebook.net).
186
+ Copyright © 2010–2022 [Casebook PBC](https://www.casebook.net).
185
187
  Licensed under the MIT license, see [LICENSE](/LICENSE) file.
data/Rakefile CHANGED
@@ -2,10 +2,20 @@
2
2
 
3
3
  require 'bundler/gem_tasks'
4
4
  require 'rspec/core/rake_task'
5
+ require 'rake/testtask'
5
6
  require 'rubocop/rake_task'
6
7
 
7
8
  desc 'Run specs'
8
- RSpec::Core::RakeTask.new
9
+ RSpec::Core::RakeTask.new(:spec) do |t|
10
+ t.pattern = Dir.glob('spec/**/*_spec.rb')
11
+ end
12
+
13
+ desc 'Run tests'
14
+ Rake::TestTask.new(:test) do |t|
15
+ t.libs << 'test'
16
+ t.libs << 'lib'
17
+ t.pattern = 'test/**/*_test.rb'
18
+ end
9
19
 
10
20
  desc 'Run lint'
11
21
  RuboCop::RakeTask.new
@@ -17,4 +27,4 @@ namespace 'doc' do
17
27
  end
18
28
  end
19
29
 
20
- task default: %i[spec rubocop]
30
+ task default: %i[spec test rubocop]
@@ -55,7 +55,11 @@ module WithModel
55
55
 
56
56
  def cleanup_descendants_tracking
57
57
  if defined?(ActiveSupport::DescendantsTracker)
58
- ActiveSupport::DescendantsTracker.class_variable_get(:@@direct_descendants).delete(ActiveRecord::Base)
58
+ if ActiveSupport::VERSION::MAJOR >= 7
59
+ ActiveSupport::DescendantsTracker.clear([ActiveRecord::Base])
60
+ else
61
+ ActiveSupport::DescendantsTracker.class_variable_get(:@@direct_descendants).delete(ActiveRecord::Base)
62
+ end
59
63
  elsif @model.superclass.respond_to?(:direct_descendants)
60
64
  @model.superclass.direct_descendants.delete(@model)
61
65
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WithModel
4
- VERSION = '2.1.5'
4
+ VERSION = '2.1.6'
5
5
  end
data/lib/with_model.rb CHANGED
@@ -6,37 +6,60 @@ require 'with_model/table'
6
6
  require 'with_model/version'
7
7
 
8
8
  module WithModel
9
+ class << self
10
+ attr_writer :runner
11
+ end
12
+
13
+ def self.runner
14
+ @runner ||= :rspec
15
+ end
16
+
9
17
  # @param [Symbol] name The constant name to assign the model class to.
10
- # @param scope Passed to `before`/`after` in the test context.
18
+ # @param scope Passed to `before`/`after` in the test context. RSpec only.
11
19
  # @param options Passed to {WithModel::Model#initialize}.
12
20
  # @param block Yielded an instance of {WithModel::Model::DSL}.
13
21
  def with_model(name, scope: nil, **options, &block)
22
+ runner = options.delete(:runner)
14
23
  model = Model.new name, **options
15
24
  dsl = Model::DSL.new model
16
25
  dsl.instance_exec(&block) if block
17
26
 
18
- before(*scope) do
19
- model.create
20
- end
21
-
22
- after(*scope) do
23
- model.destroy
24
- end
27
+ setup_object(model, scope: scope, runner: runner)
25
28
  end
26
29
 
27
30
  # @param [Symbol] name The table name to create.
28
- # @param scope Passed to `before`/`after` in the test context.
31
+ # @param scope Passed to `before`/`after` in the test context. Rspec only.
29
32
  # @param options Passed to {WithModel::Table#initialize}.
30
33
  # @param block Passed to {WithModel::Table#initialize} (like {WithModel::Model::DSL#table}).
31
34
  def with_table(name, scope: nil, **options, &block)
35
+ runner = options.delete(:runner)
32
36
  table = Table.new name, options, &block
33
37
 
34
- before(*scope) do
35
- table.create
36
- end
38
+ setup_object(table, scope: scope, runner: runner)
39
+ end
40
+
41
+ private
42
+
43
+ # @param [Object] object The new model object instance to create
44
+ # @param scope Passed to `before`/`after` in the test context. Rspec only.
45
+ def setup_object(object, scope: nil, runner: nil) # rubocop:disable Metrics/MethodLength
46
+ case runner || WithModel.runner
47
+ when :rspec
48
+ before(*scope) do
49
+ object.create
50
+ end
51
+
52
+ after(*scope) do
53
+ object.destroy
54
+ end
55
+ when :minitest
56
+ object.create
37
57
 
38
- after(*scope) do
39
- table.destroy
58
+ Minitest.after_run do
59
+ object.destroy
60
+ end
61
+ else
62
+ raise ArgumentError, 'Unsupported test runner set, expected :rspec or :minitest'
40
63
  end
41
64
  end
42
65
  end
@@ -7,6 +7,7 @@ describe 'ActiveRecord behaviors' do
7
7
  context 'that has a named scope' do
8
8
  before do
9
9
  @regular_model = Class.new ActiveRecord::Base do
10
+ self.table_name = 'regular_models'
10
11
  scope :title_is_foo, -> { where(title: 'foo') }
11
12
  end
12
13
 
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Workaround for JRuby CI failure https://github.com/jruby/jruby/issues/6547#issuecomment-774104996
4
+ if RUBY_ENGINE == 'jruby'
5
+ require 'i18n/backend'
6
+ require 'i18n/backend/simple'
7
+ end
8
+
3
9
  require 'simplecov'
4
10
  SimpleCov.start
5
11
 
@@ -36,7 +42,7 @@ if ENV['LOGGER']
36
42
  end
37
43
 
38
44
  module SpecHelper
39
- module RailsTestCompatability
45
+ module RailsTestCompatibility
40
46
  require 'minitest'
41
47
  include Minitest::Assertions
42
48
 
@@ -5,7 +5,7 @@ require 'spec_helper'
5
5
 
6
6
  shared_examples_for 'ActiveModel' do
7
7
  require 'active_model/lint'
8
- include SpecHelper::RailsTestCompatability
8
+ include SpecHelper::RailsTestCompatibility
9
9
  include ActiveModel::Lint::Tests
10
10
 
11
11
  active_model_methods = ActiveModel::Lint::Tests.public_instance_methods
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
4
+
5
+ # Workaround for JRuby CI failure https://github.com/jruby/jruby/issues/6547#issuecomment-774104996
6
+ if RUBY_ENGINE == 'jruby'
7
+ require 'i18n/backend'
8
+ require 'i18n/backend/simple'
9
+ end
10
+
11
+ require 'with_model'
12
+ require 'minitest/autorun'
13
+
14
+ WithModel.runner = :minitest
15
+
16
+ module MiniTest
17
+ class Test
18
+ extend WithModel
19
+ end
20
+ end
21
+
22
+ is_jruby = RUBY_PLATFORM == 'java'
23
+ adapter = is_jruby ? 'jdbcsqlite3' : 'sqlite3'
24
+
25
+ # WithModel requires ActiveRecord::Base.connection to be established.
26
+ # If ActiveRecord already has a connection, as in a Rails app, this is unnecessary.
27
+ require 'active_record'
28
+ ActiveRecord::Base.establish_connection(adapter: adapter, database: ':memory:')
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'test_helper'
4
+
5
+ class WithModelTest < MiniTest::Test
6
+ with_model :BlogPost do
7
+ table do |t|
8
+ t.string 'title'
9
+ t.text 'content'
10
+ t.timestamps null: false
11
+ end
12
+
13
+ model do
14
+ def fancy_title
15
+ "Title: #{title}"
16
+ end
17
+ end
18
+ end
19
+
20
+ def test_it_should_act_like_a_normal_active_record_model # rubocop:disable Minitest/MultipleAssertions
21
+ record = BlogPost.create!(title: 'New blog post', content: 'Hello, world!')
22
+
23
+ record.reload
24
+
25
+ assert_equal 'New blog post', record.title
26
+ assert_equal 'Hello, world!', record.content
27
+ assert record.updated_at
28
+
29
+ record.destroy
30
+
31
+ assert_raises ActiveRecord::RecordNotFound do
32
+ record.reload
33
+ end
34
+ end
35
+
36
+ def test_it_has_the_methods_defined_in_its_model_block
37
+ assert_equal 'Title: New blog post', BlogPost.new(title: 'New blog post').fancy_title
38
+ end
39
+ end
data/with_model.gemspec CHANGED
@@ -12,21 +12,24 @@ Gem::Specification.new do |spec|
12
12
  spec.summary = 'Dynamically build a model within an RSpec context'
13
13
  spec.description = spec.summary
14
14
  spec.license = 'MIT'
15
+ spec.metadata['rubygems_mfa_required'] = 'true'
15
16
 
16
17
  spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
20
  spec.require_paths = ['lib']
20
21
 
21
- spec.required_ruby_version = '>= 2.4'
22
+ spec.required_ruby_version = '>= 2.6'
22
23
 
23
24
  spec.add_dependency 'activerecord', '>= 5.2'
24
25
 
25
- spec.add_development_dependency 'bundler', '~> 2.0'
26
+ spec.add_development_dependency 'bundler'
26
27
  spec.add_development_dependency 'minitest'
28
+ spec.add_development_dependency 'pry'
27
29
  spec.add_development_dependency 'rake'
28
- spec.add_development_dependency 'rspec', '~> 3.0'
30
+ spec.add_development_dependency 'rspec'
29
31
  spec.add_development_dependency 'rubocop'
32
+ spec.add_development_dependency 'rubocop-minitest'
30
33
  spec.add_development_dependency 'rubocop-rake'
31
34
  spec.add_development_dependency 'rubocop-rspec'
32
35
  spec.add_development_dependency 'simplecov'
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: 2.1.5
4
+ version: 2.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Case Commons, LLC
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-11-22 00:00:00.000000000 Z
13
+ date: 2022-01-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -30,16 +30,16 @@ dependencies:
30
30
  name: bundler
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - "~>"
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
- version: '2.0'
35
+ version: '0'
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - "~>"
40
+ - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: '2.0'
42
+ version: '0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: minitest
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -54,6 +54,20 @@ dependencies:
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
+ - !ruby/object:Gem::Dependency
58
+ name: pry
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
57
71
  - !ruby/object:Gem::Dependency
58
72
  name: rake
59
73
  requirement: !ruby/object:Gem::Requirement
@@ -72,16 +86,16 @@ dependencies:
72
86
  name: rspec
73
87
  requirement: !ruby/object:Gem::Requirement
74
88
  requirements:
75
- - - "~>"
89
+ - - ">="
76
90
  - !ruby/object:Gem::Version
77
- version: '3.0'
91
+ version: '0'
78
92
  type: :development
79
93
  prerelease: false
80
94
  version_requirements: !ruby/object:Gem::Requirement
81
95
  requirements:
82
- - - "~>"
96
+ - - ">="
83
97
  - !ruby/object:Gem::Version
84
- version: '3.0'
98
+ version: '0'
85
99
  - !ruby/object:Gem::Dependency
86
100
  name: rubocop
87
101
  requirement: !ruby/object:Gem::Requirement
@@ -96,6 +110,20 @@ dependencies:
96
110
  - - ">="
97
111
  - !ruby/object:Gem::Version
98
112
  version: '0'
113
+ - !ruby/object:Gem::Dependency
114
+ name: rubocop-minitest
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ type: :development
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
99
127
  - !ruby/object:Gem::Dependency
100
128
  name: rubocop-rake
101
129
  requirement: !ruby/object:Gem::Requirement
@@ -175,12 +203,12 @@ executables: []
175
203
  extensions: []
176
204
  extra_rdoc_files: []
177
205
  files:
206
+ - ".github/workflows/ci.yml"
178
207
  - ".gitignore"
179
208
  - ".jrubyrc"
180
209
  - ".rspec"
181
210
  - ".rubocop.yml"
182
211
  - ".rubocop_todo.yml"
183
- - ".travis.yml"
184
212
  - ".yardopts"
185
213
  - CHANGELOG.md
186
214
  - Gemfile
@@ -200,11 +228,14 @@ files:
200
228
  - spec/readme_spec.rb
201
229
  - spec/spec_helper.rb
202
230
  - spec/with_model_spec.rb
231
+ - test/test_helper.rb
232
+ - test/with_model_test.rb
203
233
  - with_model.gemspec
204
234
  homepage: https://github.com/Casecommons/with_model
205
235
  licenses:
206
236
  - MIT
207
- metadata: {}
237
+ metadata:
238
+ rubygems_mfa_required: 'true'
208
239
  post_install_message:
209
240
  rdoc_options: []
210
241
  require_paths:
@@ -213,14 +244,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
213
244
  requirements:
214
245
  - - ">="
215
246
  - !ruby/object:Gem::Version
216
- version: '2.4'
247
+ version: '2.6'
217
248
  required_rubygems_version: !ruby/object:Gem::Requirement
218
249
  requirements:
219
250
  - - ">="
220
251
  - !ruby/object:Gem::Version
221
252
  version: '0'
222
253
  requirements: []
223
- rubygems_version: 3.1.4
254
+ rubygems_version: 3.3.3
224
255
  signing_key:
225
256
  specification_version: 4
226
257
  summary: Dynamically build a model within an RSpec context
@@ -231,3 +262,5 @@ test_files:
231
262
  - spec/readme_spec.rb
232
263
  - spec/spec_helper.rb
233
264
  - spec/with_model_spec.rb
265
+ - test/test_helper.rb
266
+ - test/with_model_test.rb
data/.travis.yml DELETED
@@ -1,44 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
-
4
- rvm:
5
- - 2.7.1
6
- - 2.6.6
7
- - 2.5.8
8
- - 2.4.10
9
- - jruby-9.2.13.0
10
-
11
- env:
12
- global:
13
- - CC_TEST_REPORTER_ID=fe5c8a8b1b951a54707c08b6fb2a9a5edf9e0522d28bccc648454f774c9ccab1
14
- matrix:
15
- - ACTIVE_RECORD_BRANCH="master"
16
- - ACTIVE_RECORD_VERSION="~> 6.1.0.rc1"
17
- - ACTIVE_RECORD_VERSION="~> 6.0.0"
18
- - ACTIVE_RECORD_VERSION="~> 5.2.0"
19
-
20
- matrix:
21
- fast_finish: true
22
- allow_failures:
23
- - env: ACTIVE_RECORD_BRANCH="master"
24
- - env: ACTIVE_RECORD_VERSION="~> 6.1.0.rc1"
25
- exclude:
26
- - rvm: 2.4.10
27
- env: ACTIVE_RECORD_BRANCH="master"
28
- - rvm: 2.4.10
29
- env: ACTIVE_RECORD_VERSION="~> 6.0.0"
30
- - rvm: 2.4.10
31
- env: ACTIVE_RECORD_VERSION="~> 6.1.0.rc1"
32
- - rvm: jruby-9.2.13.0
33
- env: ACTIVE_RECORD_VERSION="~> 6.0.0"
34
-
35
- before_install:
36
- - gem install bundler
37
-
38
- before_script:
39
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
40
- - chmod +x ./cc-test-reporter
41
- - ./cc-test-reporter before-build
42
-
43
- after_script:
44
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT