diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f258f11 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: [ '3.0', '3.1', '3.2', '3.3', 'jruby-9.2' ] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + + - name: Update Bundler + run: gem install bundler + + - name: Install dependencies + run: bundle install + + - name: Run tests + run: bundle exec rspec diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..1dd1998 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +ruby 3.3.5 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5a069d4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: ruby -cache: bundler - -rvm: - - 2.0 - - 2.1 - - 2.2 - - 2.3 - - 2.4 - - 2.5 - - 2.6 - - 2.7 - - jruby-9.2.8.0 - -notifications: - disabled: false - recipients: - - xijo@pm.me diff --git a/spec/lib/reverse_markdown_spec.rb b/spec/lib/reverse_markdown_spec.rb index ef5b416..04faeb2 100644 --- a/spec/lib/reverse_markdown_spec.rb +++ b/spec/lib/reverse_markdown_spec.rb @@ -36,7 +36,8 @@ describe 'force_encoding option', jruby: :exclude do it 'raises invalid byte sequence in UTF-8 exception' do - expect { ReverseMarkdown.convert("hi \255") }.to raise_error(Encoding::CompatibilityError) + # Older versions of ruby used to raise ArgumentError here. Remove when we drop support for 3.1. + expect { ReverseMarkdown.convert("hi \255") }.to raise_error { [Encoding::CompatibilityError, ArgumentError].include?(_1.class) } end it 'handles invalid byte sequence if option is set' do