diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ff83580 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2.2 + bundler: 2.5.23 + bundler-cache: true + + - name: Run test suite + run: bundle exec rake diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..a0891f5 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.3.4 diff --git a/Gemfile b/Gemfile index c896291..ffe885c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source "http://rubygems.org" +source "https://rubygems.org" gem 'rake' # Specify your gem's dependencies in omniauth-twitter.gemspec diff --git a/Gemfile.lock b/Gemfile.lock index 0402a9f..4fe372e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,14 +6,14 @@ PATH omniauth-oauth2 (~> 1.4) GEM - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) crack (0.4.2) safe_yaml (~> 1.0.0) diff-lcs (1.2.5) - docile (1.1.5) + docile (1.4.1) faraday (2.14.1) faraday-net_http (>= 2.0, < 3.5) json @@ -21,7 +21,7 @@ GEM faraday-net_http (3.4.2) net-http (~> 0.5) hashie (5.0.0) - json (1.8.2) + json (2.19.3) jwt (2.7.0) logger (1.7.0) multi_json (1.15.0) @@ -42,27 +42,34 @@ GEM omniauth-oauth2 (1.8.0) oauth2 (>= 1.4, < 3) omniauth (~> 2.0) - public_suffix (4.0.6) + public_suffix (7.0.5) rack (3.1.21) rack-protection (3.0.5) rack rack-test (0.6.3) rack (>= 1.0) rake (13.0.1) - rspec (2.99.0) - rspec-core (~> 2.99.0) - rspec-expectations (~> 2.99.0) - rspec-mocks (~> 2.99.0) - rspec-core (2.99.2) - rspec-expectations (2.99.2) - diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.99.3) + rexml (3.4.4) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) safe_yaml (1.0.4) - simplecov (0.10.0) - docile (~> 1.1.0) - json (~> 1.8) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.0) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.13.2) + simplecov_json_formatter (0.1.4) snaky_hash (2.0.1) hashie version_gem (~> 1.1, >= 1.1.1) @@ -79,8 +86,9 @@ DEPENDENCIES omniauth-bitly! rack-test rake - rspec (~> 2.7) - simplecov + rexml + rspec (~> 3.13) + simplecov (~> 0.22) webmock BUNDLED WITH diff --git a/Rakefile b/Rakefile index 7bb7c79..7c784fd 100644 --- a/Rakefile +++ b/Rakefile @@ -1,8 +1,10 @@ require "bundler/gem_tasks" -require 'rspec/core/rake_task' +require "rake/testtask" desc "Run specs" -RSpec::Core::RakeTask.new +task :spec do + sh "bundle exec rspec spec" +end -desc 'Default: run specs.' -task :default => :spec +desc "Default: run specs." +task default: :spec diff --git a/omniauth-bitly.gemspec b/omniauth-bitly.gemspec index b5b2954..97f99ec 100644 --- a/omniauth-bitly.gemspec +++ b/omniauth-bitly.gemspec @@ -20,8 +20,9 @@ Gem::Specification.new do |s| s.add_dependency 'multi_json', '~> 1.3' s.add_runtime_dependency 'omniauth-oauth2', '~> 1.4' - s.add_development_dependency 'rspec', '~> 2.7' + s.add_development_dependency 'rspec', '~> 3.13' s.add_development_dependency 'rack-test' - s.add_development_dependency 'simplecov' + s.add_development_dependency 'rexml' + s.add_development_dependency 'simplecov', '~> 0.22' s.add_development_dependency 'webmock' end diff --git a/spec/omniauth/strategies/bitly_spec.rb b/spec/omniauth/strategies/bitly_spec.rb index 2d3b20f..90d9365 100644 --- a/spec/omniauth/strategies/bitly_spec.rb +++ b/spec/omniauth/strategies/bitly_spec.rb @@ -15,7 +15,7 @@ end it 'should have correct authorize url' do - subject.options.client_options.authorize_path.should eq('/oauth/authorize') + subject.options.client_options.authorize_url.should eq('https://bitly.com/oauth/authorize') end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1447b9a..b1dc3f1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -14,3 +14,8 @@ config.extend OmniAuth::Test::StrategyMacros, :type => :strategy end +RSpec.configure do |config| + config.expect_with :rspec do |expectations| + expectations.syntax = :should + end +end