From ea7261f5d7cc195a5b73a08ab84f89da894c53eb Mon Sep 17 00:00:00 2001 From: Yuriy Orlov Date: Fri, 13 Sep 2019 17:12:32 +0300 Subject: [PATCH] Use have_implicit_order_column matcher only for rails 6 --- Appraisals | 21 +- gemfiles/rails_6_0.gemfile | 18 +- gemfiles/rails_6_0.gemfile.lock | 161 ++++++++-------- .../have_implicit_order_column.rb | 8 +- lib/shoulda/matchers/rails_shim.rb | 4 + .../acceptance/helpers/step_helpers.rb | 6 +- .../unit/helpers/active_record_versions.rb | 4 + spec/support/unit/rails_application.rb | 6 +- .../have_implicit_order_column_spec.rb | 182 +++++++++--------- 9 files changed, 216 insertions(+), 194 deletions(-) diff --git a/Appraisals b/Appraisals index 13c3472c6..447c23359 100644 --- a/Appraisals +++ b/Appraisals @@ -113,24 +113,27 @@ end if Gem::Requirement.new('>= 2.5.0').satisfied_by?(Gem::Version.new(RUBY_VERSION)) appraise 'rails_6_0' do - instance_eval(&shared_dependencies) + instance_eval(&shared_jruby_dependencies) + instance_eval(&shared_spring_dependencies) + instance_eval(&shared_test_dependencies) - gem 'rails', '~> 6.0.0.beta3' + gem 'rails', '~> 6.0.0' gem 'puma', '~> 3.11' - gem 'bootsnap', '>= 1.4.1', require: false - gem 'sass-rails', '~> 5.0' - gem 'webpacker', '>= 4.0.0.rc3' + gem 'bootsnap', '>= 1.4.2', require: false + gem 'sass-rails', '~> 5' + gem 'webpacker', '~> 4.0' gem 'turbolinks', '~> 5' - gem 'jbuilder', '~> 2.5' + gem 'jbuilder', '~> 2.7' gem 'bcrypt', '~> 3.1.7' gem 'capybara', '>= 2.15' gem 'listen', '>= 3.0.5', '< 3.2' gem 'spring-watcher-listen', '~> 2.0.0' gem 'selenium-webdriver' - gem 'chromedriver-helper' + gem 'webdrivers' # Other dependencies - gem 'rails-controller-testing', '>= 1.0.1' - gem 'pg', '~> 1.1', platform: :ruby + gem 'rails-controller-testing', '>= 1.0.4' + gem 'pg', '>= 0.18', '< 2.0', platform: :ruby + gem 'sqlite3', '~> 1.4', platform: :ruby end end diff --git a/gemfiles/rails_6_0.gemfile b/gemfiles/rails_6_0.gemfile index c8cd386b9..80a1cd2c5 100644 --- a/gemfiles/rails_6_0.gemfile +++ b/gemfiles/rails_6_0.gemfile @@ -20,24 +20,24 @@ gem "activerecord-jdbcsqlite3-adapter", platform: :jruby gem "jdbc-sqlite3", platform: :jruby gem "jruby-openssl", platform: :jruby gem "therubyrhino", platform: :jruby -gem "sqlite3", "~> 1.3.6", platform: :ruby gem "spring" gem "spring-commands-rspec" gem "minitest-reporters" gem "rspec-rails", "~> 3.6" gem "shoulda-context", "~> 1.2.0" -gem "rails", "~> 6.0.0.beta3" +gem "rails", "~> 6.0.0" gem "puma", "~> 3.11" -gem "bootsnap", ">= 1.4.1", require: false -gem "sass-rails", "~> 5.0" -gem "webpacker", ">= 4.0.0.rc3" +gem "bootsnap", ">= 1.4.2", require: false +gem "sass-rails", "~> 5" +gem "webpacker", "~> 4.0" gem "turbolinks", "~> 5" -gem "jbuilder", "~> 2.5" +gem "jbuilder", "~> 2.7" gem "bcrypt", "~> 3.1.7" gem "capybara", ">= 2.15" gem "listen", ">= 3.0.5", "< 3.2" gem "spring-watcher-listen", "~> 2.0.0" gem "selenium-webdriver" -gem "chromedriver-helper" -gem "rails-controller-testing", ">= 1.0.1" -gem "pg", "~> 1.1", platform: :ruby +gem "webdrivers" +gem "rails-controller-testing", ">= 1.0.4" +gem "pg", ">= 0.18", "< 2.0", platform: :ruby +gem "sqlite3", "~> 1.4", platform: :ruby diff --git a/gemfiles/rails_6_0.gemfile.lock b/gemfiles/rails_6_0.gemfile.lock index 45c76a629..48122397f 100644 --- a/gemfiles/rails_6_0.gemfile.lock +++ b/gemfiles/rails_6_0.gemfile.lock @@ -1,60 +1,61 @@ GEM remote: https://rubygems.org/ specs: - actioncable (6.0.0.beta3) - actionpack (= 6.0.0.beta3) + actioncable (6.0.0) + actionpack (= 6.0.0) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.0.beta3) - actionpack (= 6.0.0.beta3) - activejob (= 6.0.0.beta3) - activerecord (= 6.0.0.beta3) - activestorage (= 6.0.0.beta3) - activesupport (= 6.0.0.beta3) + actionmailbox (6.0.0) + actionpack (= 6.0.0) + activejob (= 6.0.0) + activerecord (= 6.0.0) + activestorage (= 6.0.0) + activesupport (= 6.0.0) mail (>= 2.7.1) - actionmailer (6.0.0.beta3) - actionpack (= 6.0.0.beta3) - actionview (= 6.0.0.beta3) - activejob (= 6.0.0.beta3) + actionmailer (6.0.0) + actionpack (= 6.0.0) + actionview (= 6.0.0) + activejob (= 6.0.0) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.0.beta3) - actionview (= 6.0.0.beta3) - activesupport (= 6.0.0.beta3) + actionpack (6.0.0) + actionview (= 6.0.0) + activesupport (= 6.0.0) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actiontext (6.0.0.beta3) - actionpack (= 6.0.0.beta3) - activerecord (= 6.0.0.beta3) - activestorage (= 6.0.0.beta3) - activesupport (= 6.0.0.beta3) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.0) + actionpack (= 6.0.0) + activerecord (= 6.0.0) + activestorage (= 6.0.0) + activesupport (= 6.0.0) nokogiri (>= 1.8.5) - actionview (6.0.0.beta3) - activesupport (= 6.0.0.beta3) + actionview (6.0.0) + activesupport (= 6.0.0) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (6.0.0.beta3) - activesupport (= 6.0.0.beta3) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.0) + activesupport (= 6.0.0) globalid (>= 0.3.6) - activemodel (6.0.0.beta3) - activesupport (= 6.0.0.beta3) - activerecord (6.0.0.beta3) - activemodel (= 6.0.0.beta3) - activesupport (= 6.0.0.beta3) - activestorage (6.0.0.beta3) - actionpack (= 6.0.0.beta3) - activerecord (= 6.0.0.beta3) + activemodel (6.0.0) + activesupport (= 6.0.0) + activerecord (6.0.0) + activemodel (= 6.0.0) + activesupport (= 6.0.0) + activestorage (6.0.0) + actionpack (= 6.0.0) + activejob (= 6.0.0) + activerecord (= 6.0.0) marcel (~> 0.3.1) - activesupport (6.0.0.beta3) + activesupport (6.0.0) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - zeitwerk (~> 1.3, >= 1.3.1) + zeitwerk (~> 2.1, >= 2.1.8) addressable (2.6.0) public_suffix (>= 2.0.2, < 4.0) ansi (1.5.0) @@ -62,11 +63,9 @@ GEM bundler rake thor (>= 0.14.0) - archive-zip (0.12.0) - io-like (~> 0.3.0) ast (2.4.0) bcrypt (3.1.12) - bootsnap (1.4.1) + bootsnap (1.4.5) msgpack (~> 1.0) builder (3.2.3) byebug (11.0.0) @@ -80,21 +79,17 @@ GEM xpath (~> 3.2) childprocess (0.9.0) ffi (~> 1.0, >= 1.0.11) - chromedriver-helper (2.1.0) - archive-zip (~> 0.10) - nokogiri (~> 1.8) coderay (1.1.2) concurrent-ruby (1.1.5) crass (1.0.4) diff-lcs (1.3) erubi (1.8.0) - ffi (1.10.0) + ffi (1.11.1) fssm (0.2.10) globalid (0.4.2) activesupport (>= 4.2.0) i18n (1.6.0) concurrent-ruby (~> 1.0) - io-like (0.3.0) jaro_winkler (1.5.2) jbuilder (2.8.0) activesupport (>= 4.2.0) @@ -112,7 +107,7 @@ GEM mimemagic (~> 0.3.2) method_source (0.9.2) mimemagic (0.3.3) - mini_mime (1.0.1) + mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.11.3) minitest-reporters (1.3.6) @@ -120,10 +115,10 @@ GEM builder minitest (>= 5.0) ruby-progressbar - msgpack (1.2.9) + msgpack (1.3.1) multi_json (1.13.1) - nio4r (2.3.1) - nokogiri (1.10.3) + nio4r (2.5.1) + nokogiri (1.10.4) mini_portile2 (~> 2.4.0) parallel (1.17.0) parser (2.6.3.0) @@ -144,20 +139,20 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.0.beta3) - actioncable (= 6.0.0.beta3) - actionmailbox (= 6.0.0.beta3) - actionmailer (= 6.0.0.beta3) - actionpack (= 6.0.0.beta3) - actiontext (= 6.0.0.beta3) - actionview (= 6.0.0.beta3) - activejob (= 6.0.0.beta3) - activemodel (= 6.0.0.beta3) - activerecord (= 6.0.0.beta3) - activestorage (= 6.0.0.beta3) - activesupport (= 6.0.0.beta3) + rails (6.0.0) + actioncable (= 6.0.0) + actionmailbox (= 6.0.0) + actionmailer (= 6.0.0) + actionpack (= 6.0.0) + actiontext (= 6.0.0) + actionview (= 6.0.0) + activejob (= 6.0.0) + activemodel (= 6.0.0) + activerecord (= 6.0.0) + activestorage (= 6.0.0) + activesupport (= 6.0.0) bundler (>= 1.3.0) - railties (= 6.0.0.beta3) + railties (= 6.0.0) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.4) actionpack (>= 5.0.1.x) @@ -166,11 +161,11 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.0.4) + rails-html-sanitizer (1.2.0) loofah (~> 2.2, >= 2.2.2) - railties (6.0.0.beta3) - actionpack (= 6.0.0.beta3) - activesupport (= 6.0.0.beta3) + railties (6.0.0) + actionpack (= 6.0.0) + activesupport (= 6.0.0) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) @@ -215,13 +210,13 @@ GEM ruby-progressbar (1.10.1) ruby_dep (1.5.0) rubyzip (1.2.2) - sass (3.7.3) + sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.0.7) - railties (>= 4.0.0, < 6) + sass-rails (5.1.0) + railties (>= 5.2.0) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) @@ -244,7 +239,7 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sqlite3 (1.3.13) + sqlite3 (1.4.1) thor (0.20.3) thread_safe (0.3.6) tilt (2.0.9) @@ -254,17 +249,21 @@ GEM tzinfo (1.2.5) thread_safe (~> 0.1) unicode-display_width (1.6.0) + webdrivers (4.1.2) + nokogiri (~> 1.6) + rubyzip (~> 1.0) + selenium-webdriver (>= 3.0, < 4.0) webpacker (4.0.2) activesupport (>= 4.2) rack-proxy (>= 0.6.1) railties (>= 4.2) - websocket-driver (0.7.0) + websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.3) + websocket-extensions (0.1.4) xpath (3.2.0) nokogiri (~> 1.8) yard (0.9.18) - zeitwerk (1.4.3) + zeitwerk (2.1.10) zeus (0.15.14) method_source (>= 0.6.7) @@ -276,39 +275,39 @@ DEPENDENCIES activerecord-jdbcsqlite3-adapter appraisal (= 2.2.0) bcrypt (~> 3.1.7) - bootsnap (>= 1.4.1) + bootsnap (>= 1.4.2) bundler (~> 1.1) capybara (>= 2.15) - chromedriver-helper fssm - jbuilder (~> 2.5) + jbuilder (~> 2.7) jdbc-sqlite3 jruby-openssl listen (>= 3.0.5, < 3.2) minitest-reporters - pg (~> 1.1) + pg (>= 0.18, < 2.0) pry pry-byebug puma (~> 3.11) pygments.rb - rails (~> 6.0.0.beta3) - rails-controller-testing (>= 1.0.1) + rails (~> 6.0.0) + rails-controller-testing (>= 1.0.4) rake (= 12.3.2) redcarpet rspec (~> 3.6) rspec-rails (~> 3.6) rubocop rubocop-rails - sass-rails (~> 5.0) + sass-rails (~> 5) selenium-webdriver shoulda-context (~> 1.2.0) spring spring-commands-rspec spring-watcher-listen (~> 2.0.0) - sqlite3 (~> 1.3.6) + sqlite3 (~> 1.4) therubyrhino turbolinks (~> 5) - webpacker (>= 4.0.0.rc3) + webdrivers + webpacker (~> 4.0) yard zeus diff --git a/lib/shoulda/matchers/active_record/have_implicit_order_column.rb b/lib/shoulda/matchers/active_record/have_implicit_order_column.rb index 0a3592d0d..32899ff57 100644 --- a/lib/shoulda/matchers/active_record/have_implicit_order_column.rb +++ b/lib/shoulda/matchers/active_record/have_implicit_order_column.rb @@ -2,7 +2,7 @@ module Shoulda module Matchers module ActiveRecord # The `have_implicit_order_column` matcher tests that the model has `implicit_order_column` - # assigned to one of the table columns. + # assigned to one of the table columns. (Rails 6+ only) # # class Product < ApplicationRecord # self.implicit_order_column = :created_at @@ -20,8 +20,10 @@ module ActiveRecord # # @return [HaveImplicitOrderColumnMatcher] # - def have_implicit_order_column(column) - HaveImplicitOrderColumnMatcher.new(column) + if RailsShim.active_record_gte_6? + def have_implicit_order_column(column) + HaveImplicitOrderColumnMatcher.new(column) + end end # @private diff --git a/lib/shoulda/matchers/rails_shim.rb b/lib/shoulda/matchers/rails_shim.rb index 929b64850..f01d27936 100644 --- a/lib/shoulda/matchers/rails_shim.rb +++ b/lib/shoulda/matchers/rails_shim.rb @@ -25,6 +25,10 @@ def active_record_gte_5? Gem::Requirement.new('>= 5').satisfied_by?(active_record_version) end + def active_record_gte_6? + Gem::Requirement.new('>= 6').satisfied_by?(active_record_version) + end + def active_record_version Gem::Version.new(::ActiveRecord::VERSION::STRING) rescue NameError diff --git a/spec/support/acceptance/helpers/step_helpers.rb b/spec/support/acceptance/helpers/step_helpers.rb index def4e784b..c334da1f3 100644 --- a/spec/support/acceptance/helpers/step_helpers.rb +++ b/spec/support/acceptance/helpers/step_helpers.rb @@ -79,7 +79,7 @@ def create_rails_application bundle.remove_gem 'web-console' bundle.add_gem 'pg' bundle.remove_gem 'sqlite3' - bundle.add_gem 'sqlite3', '~> 1.3.6' + bundle.add_gem 'sqlite3', sqlite3_version end fs.open('config/database.yml', 'w') do |file| @@ -125,5 +125,9 @@ def add_spring_to_project add_gem 'spring-commands-rspec' end + + def sqlite3_version + rails_version >= '6' ? '~> 1.4' : '~> 1.3.6' + end end end diff --git a/spec/support/unit/helpers/active_record_versions.rb b/spec/support/unit/helpers/active_record_versions.rb index 3cbde9cfa..cb3f35ac3 100644 --- a/spec/support/unit/helpers/active_record_versions.rb +++ b/spec/support/unit/helpers/active_record_versions.rb @@ -50,5 +50,9 @@ def active_record_supports_expression_indexes? def active_record_supports_validate_presence_on_active_storage? active_record_version >= '6.0.0.beta1' end + + def active_record_supports_implicit_order_column? + active_record_version >= '6.0.0.beta1' + end end end diff --git a/spec/support/unit/rails_application.rb b/spec/support/unit/rails_application.rb index 2f5d5dc71..f825867b3 100644 --- a/spec/support/unit/rails_application.rb +++ b/spec/support/unit/rails_application.rb @@ -194,7 +194,7 @@ def update_gems bundle.remove_gem 'web-console' bundle.add_gem 'pg' bundle.remove_gem 'sqlite3' - bundle.add_gem 'sqlite3', '~> 1.3.6' + bundle.add_gem 'sqlite3', sqlite3_version end end @@ -205,5 +205,9 @@ def run_command!(*args) def rails_version bundle.version_of('rails') end + + def sqlite3_version + rails_version >= '6' ? '~> 1.4' : '~> 1.3.6' + end end end diff --git a/spec/unit/shoulda/matchers/active_record/have_implicit_order_column_spec.rb b/spec/unit/shoulda/matchers/active_record/have_implicit_order_column_spec.rb index a10064047..5fe82fcf6 100644 --- a/spec/unit/shoulda/matchers/active_record/have_implicit_order_column_spec.rb +++ b/spec/unit/shoulda/matchers/active_record/have_implicit_order_column_spec.rb @@ -1,130 +1,132 @@ require 'unit_spec_helper' describe Shoulda::Matchers::ActiveRecord::HaveImplicitOrderColumnMatcher, type: :model do - context 'when implicit_order_column is defined for the column' do - let(:defined_model) { model(created_at: :timestamp) } + if active_record_supports_implicit_order_column? + context 'when implicit_order_column is defined for the column' do + let(:defined_model) { model(created_at: :timestamp) } - before do - defined_model.class.implicit_order_column = 'created_at' - end + before do + defined_model.class.implicit_order_column = 'created_at' + end - context 'when column name is a symbol' do - it 'accepts' do - expect(defined_model).to have_implicit_order_column(:created_at) + context 'when column name is a symbol' do + it 'accepts' do + expect(defined_model).to have_implicit_order_column(:created_at) + end end - end - context 'when column name is a string' do - it 'accepts' do - expect(defined_model).to have_implicit_order_column('created_at') + context 'when column name is a string' do + it 'accepts' do + expect(defined_model).to have_implicit_order_column('created_at') + end end end - end - context 'when implicit_order_column is defined for another column' do - let(:defined_model) { model(created_at: :timestamp, email: :string) } - let(:message) do - format_message(<<-MESSAGE, one_line: true) - Expected Employee to have implicit_order_column set to email - (Employee implicit_order_column is set to created_at) - MESSAGE - end + context 'when implicit_order_column is defined for another column' do + let(:defined_model) { model(created_at: :timestamp, email: :string) } + let(:message) do + format_message(<<-MESSAGE, one_line: true) + Expected Employee to have implicit_order_column set to email + (Employee implicit_order_column is set to created_at) + MESSAGE + end - before do - defined_model.class.implicit_order_column = 'created_at' - end + before do + defined_model.class.implicit_order_column = 'created_at' + end - context 'when column name is a symbol' do - it 'rejects with an appropriate failure message' do - assertion = lambda { - expect(defined_model).to have_implicit_order_column(:email) - } + context 'when column name is a symbol' do + it 'rejects with an appropriate failure message' do + assertion = lambda { + expect(defined_model).to have_implicit_order_column(:email) + } - expect(&assertion).to fail_with_message(message) + expect(&assertion).to fail_with_message(message) + end end - end - context 'when column name is a string' do - it 'rejects with an appropriate failure message' do - assertion = lambda { - expect(defined_model).to have_implicit_order_column('email') - } + context 'when column name is a string' do + it 'rejects with an appropriate failure message' do + assertion = lambda { + expect(defined_model).to have_implicit_order_column('email') + } - expect(&assertion).to fail_with_message(message) + expect(&assertion).to fail_with_message(message) + end end end - end - context 'when implicit_order_column is NOT defined on model' do - let(:defined_model) { model(created_at: :timestamp) } - let(:message) do - format_message(<<-MESSAGE, one_line: true) - Expected Employee to have implicit_order_column set to created_at - (Employee implicit_order_column is not set) - MESSAGE - end + context 'when implicit_order_column is NOT defined on model' do + let(:defined_model) { model(created_at: :timestamp) } + let(:message) do + format_message(<<-MESSAGE, one_line: true) + Expected Employee to have implicit_order_column set to created_at + (Employee implicit_order_column is not set) + MESSAGE + end - context 'when column name is a symbol' do - it 'rejects with an appropriate failure message' do - assertion = lambda { - expect(defined_model).to have_implicit_order_column(:created_at) - } + context 'when column name is a symbol' do + it 'rejects with an appropriate failure message' do + assertion = lambda { + expect(defined_model).to have_implicit_order_column(:created_at) + } - expect(&assertion).to fail_with_message(message) + expect(&assertion).to fail_with_message(message) + end end - end - context 'when column name is a string' do - it 'rejects with an appropriate failure message' do - assertion = lambda { - expect(defined_model).to have_implicit_order_column('created_at') - } + context 'when column name is a string' do + it 'rejects with an appropriate failure message' do + assertion = lambda { + expect(defined_model).to have_implicit_order_column('created_at') + } - expect(&assertion).to fail_with_message(message) + expect(&assertion).to fail_with_message(message) + end end end - end - context 'when given column does NOT exist' do - let(:defined_model) { model(created_at: :timestamp) } - let(:message) do - format_message(<<-MESSAGE, one_line: true) - Expected Employee to have implicit_order_column set to whatever - (Employee does not have a db column named whatever) - MESSAGE - end + context 'when given column does NOT exist' do + let(:defined_model) { model(created_at: :timestamp) } + let(:message) do + format_message(<<-MESSAGE, one_line: true) + Expected Employee to have implicit_order_column set to whatever + (Employee does not have a db column named whatever) + MESSAGE + end - context 'when column name is a symbol' do - it 'rejects with an appropriate failure message' do - assertion = lambda { - expect(defined_model).to have_implicit_order_column(:whatever) - } + context 'when column name is a symbol' do + it 'rejects with an appropriate failure message' do + assertion = lambda { + expect(defined_model).to have_implicit_order_column(:whatever) + } - expect(&assertion).to fail_with_message(message) + expect(&assertion).to fail_with_message(message) + end end - end - context 'when column name is a string' do - it 'rejects with an appropriate failure message' do - assertion = lambda { - expect(defined_model).to have_implicit_order_column('whatever') - } + context 'when column name is a string' do + it 'rejects with an appropriate failure message' do + assertion = lambda { + expect(defined_model).to have_implicit_order_column('whatever') + } - expect(&assertion).to fail_with_message(message) + expect(&assertion).to fail_with_message(message) + end end end - end - describe 'description' do - it 'returns correct description' do - matcher = have_implicit_order_column(:created_at) + describe 'description' do + it 'returns correct description' do + matcher = have_implicit_order_column(:created_at) - expect(matcher.description).to \ - eq('have implicit_order_column assigned to created_at') + expect(matcher.description).to \ + eq('have implicit_order_column assigned to created_at') + end end - end - def model(options = {}) - define_model(:employee, options).new + def model(options = {}) + define_model(:employee, options).new + end end end