Skip to content

Commit db0367e

Browse files
authored
Merge branch '0-10-stable' into 0-10-stable
2 parents 383a380 + 60ba54a commit db0367e

File tree

12 files changed

+101
-345
lines changed

12 files changed

+101
-345
lines changed

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
3+
name: CI
4+
5+
on:
6+
- "push"
7+
8+
jobs:
9+
test:
10+
name: "Testing"
11+
runs-on: ubuntu-18.04
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
# Recent Rubies and Rails
17+
- ruby-version: '2.6'
18+
rails-version: '6.1'
19+
- ruby-version: '2.6'
20+
rails-version: '6.0'
21+
- ruby-version: '2.7'
22+
rails-version: '6.0'
23+
- ruby-version: '2.6'
24+
rails-version: '5.2'
25+
# Old Rubies and Rails
26+
- ruby-version: '2.5'
27+
rails-version: '5.1'
28+
bundler: '1'
29+
- ruby-version: '2.4'
30+
rails-version: '5.0'
31+
bundler: '1'
32+
- ruby-version: '2.4'
33+
rails-version: '4.2'
34+
bundler: '1'
35+
# Failing with a stack trace in active support
36+
# - ruby-version: '2.4'
37+
# rails-version: '4.1'
38+
# bundler: '1'
39+
40+
continue-on-error: "${{ endsWith(matrix.ruby-version, 'head') }}"
41+
42+
env:
43+
CI: "1"
44+
45+
steps:
46+
- name: "Checkout Code"
47+
uses: "actions/checkout@v2"
48+
timeout-minutes: 5
49+
with:
50+
fetch-depth: 0
51+
52+
- name: Install required libs
53+
run: |
54+
sudo apt-get -yqq install libsqlite3-dev
55+
56+
- name: "Build Ruby"
57+
uses: ruby/setup-ruby@v1
58+
with:
59+
ruby-version: "${{ matrix.ruby-version }}"
60+
bundler: "${{ matrix.bundler || 2 }}"
61+
bundler-cache: true
62+
env:
63+
RAILS_VERSION: ${{ matrix.rails-version }}
64+
65+
- name: "Run tests"
66+
run: |
67+
bundle exec rake
68+
env:
69+
RAILS_VERSION: ${{ matrix.rails-version }}

.simplecov

Lines changed: 0 additions & 110 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<td>
1414
<a href="https://codeclimate.com/github/rails-api/active_model_serializers"><img src="https://codeclimate.com/github/rails-api/active_model_serializers/badges/gpa.svg" alt="Code Quality"></a>
1515
<a href="https://codebeat.co/projects/mygithub.libinneed.workers.dev-rails-api-active_model_serializers"><img src="https://codebeat.co/badges/a9ab35fa-8b5a-4680-9d4e-a81f9a55ebcd" alt="codebeat" ></a>
16-
<a href="https://codeclimate.com/github/rails-api/active_model_serializers/coverage"><img src="https://codeclimate.com/github/rails-api/active_model_serializers/badges/coverage.svg" alt="Test Coverage"></a>
1716
</td>
1817
</tr>
1918
<tr>

Rakefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ begin
55
rescue LoadError
66
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
77
end
8-
begin
9-
require 'simplecov'
10-
rescue LoadError # rubocop:disable Lint/HandleExceptions
11-
end
128
import('lib/tasks/rubocop.rake')
139

1410
Bundler::GemHelper.install_tasks
@@ -56,13 +52,20 @@ namespace :test do
5652
# https://github.com/rails/rails/blob/3d590add45/railties/lib/rails/generators/app_base.rb#L345-L363
5753
_bundle_command = Gem.bin_path('bundler', 'bundle')
5854
require 'bundler'
59-
Bundler.with_clean_env do
55+
with_clean_env = proc do
6056
isolated_test_files.all? do |test_file|
6157
command = "-w -I#{dir}/lib -I#{dir}/test #{Shellwords.shellescape(test_file)}"
6258
full_command = %("#{Gem.ruby}" #{command})
6359
system(full_command)
6460
end or fail 'Failures' # rubocop:disable Style/AndOr
6561
end
62+
bundler_method =
63+
if Bundler.method_defined?(:with_unbundled_env)
64+
:with_unbundled_env
65+
else
66+
:with_clean_env
67+
end
68+
Bundler.public_send(bundler_method, &with_clean_env)
6669
end
6770
end
6871

active_model_serializers.gemspec

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ Gem::Specification.new do |spec|
5555
spec.add_development_dependency 'will_paginate', '~> 3.0', '>= 3.0.7'
5656

5757
spec.add_development_dependency 'bundler'
58-
spec.add_development_dependency 'simplecov', '>= 0.11'
5958
spec.add_development_dependency 'timecop', '~> 0.7'
60-
spec.add_development_dependency 'grape', ['>= 0.13', '< 0.19.1']
59+
spec.add_development_dependency 'grape', '>= 0.13'
6160
spec.add_development_dependency 'json_schema'
62-
spec.add_development_dependency 'rake', ['>= 10.0', '< 13.0']
61+
spec.add_development_dependency 'rake', '>= 10.0'
6362
end

docs/STYLE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
- [Improve code quality](https://codeclimate.com/github/rails-api/active_model_serializers/code?sort=smell_count&sort_direction=desc).
2020

21-
- [Improve amount of code exercised by tests](https://codeclimate.com/github/rails-api/active_model_serializers/coverage?sort=covered_percent&sort_direction=asc).
22-
2321
- [Fix RuboCop (Style) TODOS](https://github.com/rails-api/active_model_serializers/blob/master/.rubocop_todo.yml).
2422
- Delete and offsense, run `rake rubocop` (or possibly `rake rubocop:auto_correct`),
2523
and [submit a PR](CONTRIBUTING.md#submitting-a-pull-request-pr).

test/action_controller/explicit_serializer_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ def render_using_explicit_each_serializer
7171
def test_render_using_explicit_serializer
7272
get :render_using_explicit_serializer
7373

74-
assert_equal 'application/json', @response.content_type
74+
assert_match(%r{\Aapplication/json}, @response.content_type)
7575
assert_equal '{"name":"Name 1"}', @response.body
7676
end
7777

7878
def test_render_array_using_explicit_serializer
7979
get :render_array_using_explicit_serializer
80-
assert_equal 'application/json', @response.content_type
80+
assert_match(%r{\Aapplication/json}, @response.content_type)
8181

8282
expected = [
8383
{ 'name' => 'Name 1' },
@@ -89,7 +89,7 @@ def test_render_array_using_explicit_serializer
8989

9090
def test_render_array_using_implicit_serializer
9191
get :render_array_using_implicit_serializer
92-
assert_equal 'application/json', @response.content_type
92+
assert_match(%r{\Aapplication/json}, @response.content_type)
9393

9494
expected = [
9595
{ 'name' => 'Name 1' },

0 commit comments

Comments
 (0)