diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..810a1a1 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1 @@ +repo_token: 9oh3FPpJIPhz4dxqpNINA5HWXXdFwuW32 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b20426..d3aefe5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,15 +22,15 @@ jobs: runs-on: ubuntu-latest env: CI: true + ALLOW_FAILURES: ${{ endsWith(matrix.ruby, 'head') }} strategy: fail-fast: false matrix: ruby: - - 2.4 - - 2.5 - 2.6 - 2.7 - 3.0 + - 3.1 - ruby-head - jruby steps: @@ -43,5 +43,9 @@ jobs: - name: Install dependencies run: bundle install --jobs 4 --retry 3 - name: Run tests - run: bundle exec rspec spec - + run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES + - name: Coveralls GitHub Action + uses: coverallsapp/github-action@v1.1.2 + if: "matrix.ruby == '3.0'" + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b5997e8..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: ruby -script: "bundle exec rspec spec" -env: - - CI=true -rvm: - - 2.4 - - 2.5 - - 2.6 - - 2.7 - - ruby-head - - jruby -cache: bundler -sudo: false -matrix: - allow_failures: - - rvm: jruby - - rvm: ruby-head -dist: trusty diff --git a/Gemfile b/Gemfile index a2d8307..6c2ee4d 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,6 @@ group :debug do end group :development, :test do - gem 'simplecov', require: false, platforms: :mri - gem 'coveralls', require: false, platforms: :mri + gem 'simplecov', '~> 0.21', platforms: :mri + gem 'simplecov-lcov', '~> 0.8', platforms: :mri end \ No newline at end of file diff --git a/README.md b/README.md index 64252f2..1c21f6c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ and shared examples for Ruby projects that use RDF.rb and RSpec. [![Gem Version](https://badge.fury.io/rb/rdf-spec.png)](https://badge.fury.io/rb/rdf-spec) [![Build Status](https://github.com/ruby-rdf/rdf-spec/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-spec/actions?query=workflow%3ACI) -[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-spec/badge.svg)](https://coveralls.io/github/ruby-rdf/rdf-spec) +[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-spec/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-spec?branch=develop) [![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf) ## Documentation @@ -30,8 +30,8 @@ Note that in most cases, if the instance is empty and mutable, the appropriate s ## Dependencies -* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.0) -* [RSpec](https://rubygems.org/gems/rspec) (~> 3.7) +* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.2) +* [RSpec](https://rubygems.org/gems/rspec) (~> 3.10) ## Installation diff --git a/VERSION b/VERSION index ef538c2..944880f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.2 +3.2.0 diff --git a/etc/doap.ttl b/etc/doap.ttl index 897ab6c..030954e 100644 --- a/etc/doap.ttl +++ b/etc/doap.ttl @@ -1,4 +1,4 @@ -@base . +@base . @prefix rdf: . @prefix rdfs: . @prefix dc: . @@ -6,53 +6,23 @@ @prefix doap: . <> a doap:Project ; - doap:name "RDF.rb" ; - doap:homepage ; + doap:name "RDF::Spec" ; + doap:homepage ; doap:license ; - doap:shortdesc "A Ruby library for working with Resource Description Framework (RDF) data."@en ; - doap:description "RDF.rb is a pure-Ruby library for working with Resource Description Framework (RDF) data."@en ; - doap:created "2007-10-23" ; + doap:shortdesc "RSpec extensions for RDF.rb."@en ; + doap:description "RDF.rb extension that provides RSpec matchers and shared examples for RDF objects."@en ; + doap:created "2007-02-03" ; doap:programming-language "Ruby" ; doap:category , ; - doap:implements , - , - ; - doap:download-page ; - doap:bug-database ; + doap:download-page <> ; + doap:bug-database ; doap:blog , ; doap:developer , , ; doap:maintainer ; - doap:documenter , , ; - doap:helper [a foaf:Person ; - foaf:name "Călin Ardelean" ; - foaf:mbox_sha1sum "274bd18402fc773ffc0606996aa1fb90b603aa29"] ; - doap:helper [a foaf:Person ; - foaf:name "Danny Gagne" ; - foaf:mbox_sha1sum "6de43e9cf7de53427fea9765706703e4d957c17b"] ; - doap:helper [a foaf:Person ; - foaf:name "Joey Geiger" ; - foaf:mbox_sha1sum "f412d743150d7b27b8468d56e69ca147917ea6fc"] ; - doap:helper [a foaf:Person ; - foaf:name "Fumihiro Kato" ; - foaf:mbox_sha1sum "d31fdd6af7a279a89bf09fdc9f7c44d9d08bb930"] ; - doap:helper [a foaf:Person ; - foaf:name "Naoki Kawamukai" ; - foaf:mbox_sha1sum "5bdcd8e2af4f5952aaeeffbdd371c41525ec761d"] ; - doap:helper [a foaf:Person ; - foaf:name "Hellekin O. Wolf" ; - foaf:mbox_sha1sum "c69f3255ff0639543cc5edfd8116eac8df16fab8"] ; - doap:helper [a foaf:Person ; - foaf:name "John Fieber" ; - foaf:mbox_sha1sum "f7653fc1ac0e82ebb32f092389bd5fc728eaae12"] ; - doap:helper [a foaf:Person ; - foaf:name "Keita Urashima" ; - foaf:mbox_sha1sum "2b4247b6fd5bb4a1383378f325784318680d5ff9"] ; - doap:helper [a foaf:Person ; - foaf:name "Pius Uzamere" ; - foaf:mbox_sha1sum "bedbbf2451e5beb38d59687c0460032aff92cd3c"] ; - foaf:maker ; - dc:creator . + doap:documenter ; + foaf:maker ; + dc:creator . a foaf:Person ; foaf:name "Arto Bendiken" ; @@ -67,6 +37,7 @@ foaf:mbox_sha1sum "dbf45f4ffbd27b67aa84f02a6a31c144727d10af" ; foaf:homepage . + a foaf:Person ; foaf:name "Gregg Kellogg" ; foaf:mbox ; diff --git a/lib/rdf/spec/inspects.rb b/lib/rdf/spec/inspects.rb index 2e36617..a45832d 100644 --- a/lib/rdf/spec/inspects.rb +++ b/lib/rdf/spec/inspects.rb @@ -3,7 +3,9 @@ class RDF::Literal def inspect - "\"#{escape(value)}\" R:L:(#{self.class.to_s.match(/([^:]*)$/)})" + klass = self.class.to_s.match(/([^:]*)$/).to_s + dt = self.datatype + "\"#{escape(value)}\"#{('@' + self.language.to_s) if self.language?} R:L:(#{klass == 'Literal' && dt ? dt : klass})" end end diff --git a/lib/rdf/spec/literal.rb b/lib/rdf/spec/literal.rb index 76321eb..a9d4401 100644 --- a/lib/rdf/spec/literal.rb +++ b/lib/rdf/spec/literal.rb @@ -5,6 +5,7 @@ # include the examples for `RDF::Literal`, `RDF::Literal validation`, # `RDF::Literal canonicalization`, and `RDF::Literal lookup`. +# @private shared_examples 'RDF::Literal' do |value, datatype_uri| include_examples 'RDF::Literal with datatype and grammar', value, datatype_uri include_examples 'RDF::Literal equality', value, value diff --git a/lib/rdf/spec/matchers.rb b/lib/rdf/spec/matchers.rb index e3bd4f7..1f60d4d 100644 --- a/lib/rdf/spec/matchers.rb +++ b/lib/rdf/spec/matchers.rb @@ -1,5 +1,5 @@ require 'rspec/matchers' # @see https://rubygems.org/gems/rspec -require 'awesome_print' +require 'amazing_print' module RDF; module Spec ## @@ -273,7 +273,7 @@ def io_name @info = if (info.id rescue false) info elsif info.is_a?(Logger) - Info.new(logger: info) + Info.new({logger: info}) elsif info.is_a?(Hash) Info.new(info[:id], info[:logger], info[:action], info[:result], info[:format], info[:base], info[:prefixes]) else diff --git a/rdf-spec.gemspec b/rdf-spec.gemspec index 2ea44e2..456b4fd 100755 --- a/rdf-spec.gemspec +++ b/rdf-spec.gemspec @@ -18,15 +18,15 @@ Gem::Specification.new do |gem| gem.files = %w(AUTHORS CREDITS README.md UNLICENSE VERSION) + Dir.glob('etc/*') + Dir.glob('lib/**/*.rb') + Dir.glob('spec/*.rb') gem.require_paths = %w(lib) - gem.required_ruby_version = '>= 2.4' + gem.required_ruby_version = '>= 2.6' gem.requirements = [] - gem.add_runtime_dependency 'rdf', '~> 3.1', '>= 3.1.8' - gem.add_runtime_dependency 'awesome_print', '~> 1.8' - gem.add_runtime_dependency 'rdf-isomorphic', '~> 3.1' - gem.add_runtime_dependency 'rspec', '~> 3.9' + gem.add_runtime_dependency 'rdf', '~> 3.2' + gem.add_runtime_dependency 'amazing_print', '~> 1.4' + gem.add_runtime_dependency 'rdf-isomorphic', '~> 3.2' + gem.add_runtime_dependency 'rspec', '~> 3.10' gem.add_runtime_dependency 'rspec-its', '~> 1.3' gem.add_runtime_dependency 'rexml', '~> 3.2' # For Webmock - gem.add_runtime_dependency 'webmock', '~> 3.7' + gem.add_runtime_dependency 'webmock', '~> 3.14' gem.add_development_dependency 'yard' , '~> 0.9' gem.post_install_message = nil end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2dc0a0e..42d7729 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,10 +2,17 @@ require 'rdf' begin require 'simplecov' - require 'coveralls' + require 'simplecov-lcov' + + SimpleCov::Formatter::LcovFormatter.config do |config| + #Coveralls is coverage by default/lcov. Send info results + config.report_with_single_file = true + config.single_report_path = 'coverage/lcov.info' + end + SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ SimpleCov::Formatter::HTMLFormatter, - Coveralls::SimpleCov::Formatter + SimpleCov::Formatter::LcovFormatter ]) SimpleCov.start do add_filter "matchers.rb"