Skip to content

Commit

Permalink
Create ruby.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ksol committed May 12, 2021
1 parent f2cb39c commit 3477d7b
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 29 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: CI - PR/master

on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
bundler-cache: true
- name: Rubocop checks
run: bundle exec rubocop

test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0']
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rake
8 changes: 8 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ require:
- standard
- rubocop-performance

AllCops:
SuggestExtensions: false
Exclude:
- 'node_modules/**/*'
- 'tmp/**/*'
- 'vendor/**/*'
- '.git/**/*'

Style/TrailingCommaInArguments:
Enabled: true
EnforcedStyleForMultiline: consistent_comma
Expand Down
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion scalingo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Gem::Specification.new do |s|
s.add_development_dependency "bundler", "~> 2.0"
s.add_development_dependency "rake", "~> 13.0"
s.add_development_dependency "rspec", "~> 3.0"
s.add_development_dependency "standard", "~> 0.10.1"
s.add_development_dependency "standard", "~> 1.1.0"
s.add_development_dependency "rubocop-rspec"
s.add_development_dependency "pry", "~> 0.13.1"
s.add_development_dependency "webmock", "~> 3.10.0"
end
4 changes: 2 additions & 2 deletions spec/scalingo/api/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@
expect(mock).to receive(:new).with(instance).and_return("1st").once

# Not yet loaded...
expect(instance.instance_variable_get(:"@handler")).to eq(nil)
expect(instance.instance_variable_get(:@handler)).to eq(nil)
instance.handler

# Memoized...
expect(instance.instance_variable_get(:"@handler")).not_to eq(nil)
expect(instance.instance_variable_get(:@handler)).not_to eq(nil)

# More calls won't try to perform more instanciations
instance.handler
Expand Down
4 changes: 2 additions & 2 deletions spec/scalingo/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
context "with access token" do
it "is successful with valid token" do
fake_response = OpenStruct.new(
"successful?": true,
successful?: true,
data: {token: "response token"},
)

Expand All @@ -64,7 +64,7 @@

it "fails with invalid token" do
fake_response = OpenStruct.new(
"successful?": false,
successful?: false,
)

expect(subject.auth.tokens).to receive(:exchange).and_return(fake_response)
Expand Down

0 comments on commit 3477d7b

Please sign in to comment.