From f52e6eb54d6e1aa3e1e05f5e5f641d9d3f4730f3 Mon Sep 17 00:00:00 2001 From: Drew Ulmer Date: Tue, 22 Sep 2020 10:50:55 -0500 Subject: [PATCH] Add appraisal config for Rails 5.1 (#56) * Add appraisal config for Rails 5.1 * Configure travis to run for Rails 5.1 * Fix a few standardrb issues These only warn on the 5.1 branch, not sure why. --- .travis.yml | 1 + Appraisals | 7 + gemfiles/rails_5_1.gemfile | 22 ++ gemfiles/rails_5_1.gemfile.lock | 243 ++++++++++++++++++ .../declarative_streams_spec.rb | 8 +- .../log_suppression_spec.rb | 8 +- 6 files changed, 281 insertions(+), 8 deletions(-) create mode 100644 gemfiles/rails_5_1.gemfile create mode 100644 gemfiles/rails_5_1.gemfile.lock diff --git a/.travis.yml b/.travis.yml index 134b71e..fe0dd18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ rvm: - 2.7.1 gemfile: + - gemfiles/rails_5_1.gemfile - gemfiles/rails_5_2.gemfile - gemfiles/rails_6_0.gemfile - gemfiles/rails_master.gemfile diff --git a/Appraisals b/Appraisals index 8dd03ad..6d64e68 100644 --- a/Appraisals +++ b/Appraisals @@ -1,3 +1,10 @@ +appraise "rails-5-1" do + gem "rails", "~> 5.1" + + # Rails 5 does not have built-in support for ActionCable tests. + gem "action-cable-testing" +end + appraise "rails-5-2" do gem "rails", "~> 5.2" diff --git a/gemfiles/rails_5_1.gemfile b/gemfiles/rails_5_1.gemfile new file mode 100644 index 0000000..d8900d0 --- /dev/null +++ b/gemfiles/rails_5_1.gemfile @@ -0,0 +1,22 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "pry" +gem "rake", "~> 12.0" +gem "rspec", "~> 3.0" +gem "rspec-rails" +gem "standard" +gem "view_component" +gem "simplecov", "< 0.18", require: false +gem "generator_spec" +gem "capybara", ">= 2.15", "< 4.0" +gem "selenium-webdriver" +gem "puma" +gem "webpacker" +gem "sqlite3" +gem "appraisal" +gem "rails", "~> 5.1" +gem "action-cable-testing" + +gemspec path: "../" diff --git a/gemfiles/rails_5_1.gemfile.lock b/gemfiles/rails_5_1.gemfile.lock new file mode 100644 index 0000000..ea9a33e --- /dev/null +++ b/gemfiles/rails_5_1.gemfile.lock @@ -0,0 +1,243 @@ +PATH + remote: .. + specs: + motion (0.4.2) + lz4-ruby (>= 0.3.3) + nokogiri + rails (>= 5.2) + +GEM + remote: https://rubygems.org/ + specs: + action-cable-testing (0.6.1) + actioncable (>= 5.0) + actioncable (5.2.4.4) + actionpack (= 5.2.4.4) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (5.2.4.4) + actionpack (= 5.2.4.4) + actionview (= 5.2.4.4) + activejob (= 5.2.4.4) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.2.4.4) + actionview (= 5.2.4.4) + activesupport (= 5.2.4.4) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.2.4.4) + activesupport (= 5.2.4.4) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.2.4.4) + activesupport (= 5.2.4.4) + globalid (>= 0.3.6) + activemodel (5.2.4.4) + activesupport (= 5.2.4.4) + activerecord (5.2.4.4) + activemodel (= 5.2.4.4) + activesupport (= 5.2.4.4) + arel (>= 9.0) + activestorage (5.2.4.4) + actionpack (= 5.2.4.4) + activerecord (= 5.2.4.4) + marcel (~> 0.3.1) + activesupport (5.2.4.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + appraisal (2.3.0) + bundler + rake + thor (>= 0.14.0) + arel (9.0.0) + ast (2.4.1) + builder (3.2.4) + capybara (3.33.0) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + childprocess (3.0.0) + coderay (1.1.3) + concurrent-ruby (1.1.7) + crass (1.0.6) + diff-lcs (1.4.4) + docile (1.3.2) + erubi (1.9.0) + generator_spec (0.9.4) + activesupport (>= 3.0.0) + railties (>= 3.0.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + i18n (1.8.5) + concurrent-ruby (~> 1.0) + json (2.3.1) + loofah (2.7.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + lz4-ruby (0.3.3) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.0.0) + mimemagic (0.3.5) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.14.2) + nio4r (2.5.4) + nokogiri (1.10.10) + mini_portile2 (~> 2.4.0) + parallel (1.19.2) + parser (2.7.1.4) + ast (~> 2.4.1) + pry (0.13.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.6) + puma (5.0.0) + nio4r (~> 2.0) + rack (2.2.3) + rack-proxy (0.6.5) + rack + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (5.2.4.4) + actioncable (= 5.2.4.4) + actionmailer (= 5.2.4.4) + actionpack (= 5.2.4.4) + actionview (= 5.2.4.4) + activejob (= 5.2.4.4) + activemodel (= 5.2.4.4) + activerecord (= 5.2.4.4) + activestorage (= 5.2.4.4) + activesupport (= 5.2.4.4) + bundler (>= 1.3.0) + railties (= 5.2.4.4) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (5.2.4.4) + actionpack (= 5.2.4.4) + activesupport (= 5.2.4.4) + method_source + rake (>= 0.8.7) + thor (>= 0.19.0, < 2.0) + rainbow (3.0.0) + rake (12.3.3) + regexp_parser (1.8.0) + rexml (3.2.4) + rspec (3.9.0) + rspec-core (~> 3.9.0) + rspec-expectations (~> 3.9.0) + rspec-mocks (~> 3.9.0) + rspec-core (3.9.2) + rspec-support (~> 3.9.3) + rspec-expectations (3.9.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-mocks (3.9.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-rails (4.0.1) + actionpack (>= 4.2) + activesupport (>= 4.2) + railties (>= 4.2) + rspec-core (~> 3.9) + rspec-expectations (~> 3.9) + rspec-mocks (~> 3.9) + rspec-support (~> 3.9) + rspec-support (3.9.3) + rubocop (0.91.0) + parallel (~> 1.10) + parser (>= 2.7.1.1) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.7) + rexml + rubocop-ast (>= 0.4.0, < 1.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 2.0) + rubocop-ast (0.4.2) + parser (>= 2.7.1.4) + rubocop-performance (1.8.1) + rubocop (>= 0.87.0) + rubocop-ast (>= 0.4.0) + ruby-progressbar (1.10.1) + rubyzip (2.3.0) + selenium-webdriver (3.142.7) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) + semantic_range (2.3.0) + simplecov (0.17.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + sprockets (4.0.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.2) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + standard (0.6.1) + rubocop (~> 0.90) + rubocop-performance (~> 1.8.0) + thor (1.0.1) + thread_safe (0.3.6) + tzinfo (1.2.7) + thread_safe (~> 0.1) + unicode-display_width (1.7.0) + view_component (2.19.1) + activesupport (>= 5.0.0, < 7.0) + webpacker (5.2.1) + activesupport (>= 5.2) + rack-proxy (>= 0.6.1) + railties (>= 5.2) + semantic_range (>= 2.3.0) + websocket-driver (0.7.3) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + +PLATFORMS + ruby + +DEPENDENCIES + action-cable-testing + appraisal + capybara (>= 2.15, < 4.0) + generator_spec + motion! + pry + puma + rails (~> 5.1) + rake (~> 12.0) + rspec (~> 3.0) + rspec-rails + selenium-webdriver + simplecov (< 0.18) + sqlite3 + standard + view_component + webpacker + +BUNDLED WITH + 2.1.4 diff --git a/spec/motion/action_cable_extentions/declarative_streams_spec.rb b/spec/motion/action_cable_extentions/declarative_streams_spec.rb index 76d898f..7a719b4 100644 --- a/spec/motion/action_cable_extentions/declarative_streams_spec.rb +++ b/spec/motion/action_cable_extentions/declarative_streams_spec.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true +class TestChannel < ApplicationCable::Channel + include Motion::ActionCableExtentions::DeclarativeStreams +end + # TODO: These unit tests are very lacking because of the stubbing done by the # ActionCable test helpers. There currently does not seem to be any way to setup # and handle a real broadcast. RSpec.describe Motion::ActionCableExtentions::DeclarativeStreams do - class TestChannel < ApplicationCable::Channel - include Motion::ActionCableExtentions::DeclarativeStreams - end - describe TestChannel, type: :channel do before(:each) { subscribe } diff --git a/spec/motion/action_cable_extentions/log_suppression_spec.rb b/spec/motion/action_cable_extentions/log_suppression_spec.rb index 4e9f9ce..121ae8b 100644 --- a/spec/motion/action_cable_extentions/log_suppression_spec.rb +++ b/spec/motion/action_cable_extentions/log_suppression_spec.rb @@ -1,10 +1,10 @@ # frozen_string_literal: true -RSpec.describe Motion::ActionCableExtentions::LogSuppression do - class TestChannel < ApplicationCable::Channel - include Motion::ActionCableExtentions::LogSuppression - end +class TestChannel < ApplicationCable::Channel + include Motion::ActionCableExtentions::LogSuppression +end +RSpec.describe Motion::ActionCableExtentions::LogSuppression do describe TestChannel, type: :channel do before(:each) { subscribe }