Skip to content

Commit 918f701

Browse files
committed
Finish 3.1.2
2 parents 74a6600 + ab7c255 commit 918f701

File tree

9 files changed

+88
-21
lines changed

9 files changed

+88
-21
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow runs continuous CI across different versions of ruby on all branches and pull requests to develop.
2+
3+
name: CI
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the develop branch
8+
push:
9+
branches: [ '**' ]
10+
pull_request:
11+
branches: [ develop ]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
# This workflow contains a single job called "build"
19+
tests:
20+
name: Ruby ${{ matrix.ruby }}
21+
if: "contains(github.event.commits[0].message, '[ci skip]') == false"
22+
runs-on: ubuntu-latest
23+
env:
24+
CI: true
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
ruby:
29+
- 2.4
30+
- 2.5
31+
- 2.6
32+
- 2.7
33+
- 3.0
34+
- ruby-head
35+
- jruby
36+
steps:
37+
- name: Clone repository
38+
uses: actions/checkout@v2
39+
- name: Set up Ruby
40+
uses: ruby/setup-ruby@v1
41+
with:
42+
ruby-version: ${{ matrix.ruby }}
43+
- name: Install dependencies
44+
run: bundle install --jobs 4 --retry 3
45+
- name: Run tests
46+
run: bundle exec rspec spec
47+

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ rvm:
77
- 2.5
88
- 2.6
99
- 2.7
10+
- ruby-head
1011
- jruby
1112
cache: bundler
1213
sudo: false
1314
matrix:
1415
allow_failures:
1516
- rvm: jruby
17+
- rvm: ruby-head
1618
dist: trusty

CONTRIBUTING.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to manage devel
2828
enough, be assured we will eventually add you in there.
2929
* Do note that in order for us to merge any non-trivial changes (as a rule
3030
of thumb, additions larger than about 15 lines of code), we need an
31-
explicit [public domain dedication][PDD] on record from you.
31+
explicit [public domain dedication][PDD] on record from you,
32+
which you will be asked to agree to on the first commit to a repo within the organization.
33+
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
3234

3335
[YARD]: https://yardoc.org/
3436
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
35-
[PDD]: https://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
36-
[pr]: https://github.com/ruby-rdf/rdf-spec/compare/
37+
[PDD]: https://unlicense.org/#unlicensing-contributions
38+
[pr]: https://github.com/ruby-rdf/rdf/compare/

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ group :debug do
1010
end
1111

1212
group :development, :test do
13-
gem 'simplecov', platforms: :mri
14-
gem 'coveralls', '~> 0.8', platforms: :mri
13+
gem 'simplecov', require: false, platforms: :mri
14+
gem 'coveralls', require: false, platforms: :mri
1515
end

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
This is an [RDF.rb][] extension that provides RDF-specific [RSpec][] matchers
44
and shared examples for Ruby projects that use RDF.rb and RSpec.
55

6-
* <https://github.com/ruby-rdf/rdf-spec>
7-
86
[![Gem Version](https://badge.fury.io/rb/rdf-spec.png)](https://badge.fury.io/rb/rdf-spec)
9-
[![Build Status](https://travis-ci.org/ruby-rdf/rdf-spec.png?branch=master)](https://travis-ci.org/ruby-rdf/rdf-spec)
10-
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-spec/badge.svg)](https://coveralls.io/r/ruby-rdf/rdf-spec)
7+
[![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)
8+
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-spec/badge.svg)](https://coveralls.io/github/ruby-rdf/rdf-spec)
9+
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
1110

1211
## Documentation
1312

@@ -76,7 +75,9 @@ follows:
7675
enough, be assured we will eventually add you in there.
7776
* Do note that in order for us to merge any non-trivial changes (as a rule
7877
of thumb, additions larger than about 15 lines of code), we need an
79-
explicit [public domain dedication][PDD] on record from you.
78+
explicit [public domain dedication][PDD] on record from you,
79+
which you will be asked to agree to on the first commit to a repo within the organization.
80+
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
8081

8182
License
8283
-------
@@ -87,4 +88,4 @@ see <https://unlicense.org/> or the accompanying {file:UNLICENSE} file.
8788
[RDF.rb]: https://rubygems.org/gems/rdf
8889
[RSpec]: https://rspec.info/
8990
[RubySpec]: https://rubyspec.org/wiki/rubyspec/Style_Guide
90-
[PDD]: https://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
91+
[PDD]: https://unlicense.org/#unlicensing-contributions

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.1
1+
3.1.2

lib/rdf/spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def to_s
8787
end
8888
end
8989
logger.level = Logger::DEBUG
90-
logger.formatter = lambda {|severity, datetime, progname, msg| "#{severity} #{msg}\n"}
90+
logger.formatter = lambda {|severity, datetime, progname, msg| "%5s %s\n" % [severity, msg]}
9191
logger
9292
end
9393
end # Spec

lib/rdf/spec/matchers.rb

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,16 +266,16 @@ def io_name
266266
end
267267
end
268268

269-
Info = Struct.new(:id, :logger, :action, :result, :format)
269+
Info = Struct.new(:id, :logger, :action, :result, :format, :base, :prefixes)
270270

271271
RSpec::Matchers.define :be_equivalent_graph do |expected, info|
272272
match do |actual|
273273
@info = if (info.id rescue false)
274274
info
275275
elsif info.is_a?(Logger)
276-
Info.new("", info)
276+
Info.new(logger: info)
277277
elsif info.is_a?(Hash)
278-
Info.new(info[:id], info[:logger], info[:action], info[:result], info[:format])
278+
Info.new(info[:id], info[:logger], info[:action], info[:result], info[:format], info[:base], info[:prefixes])
279279
else
280280
Info.new(info)
281281
end
@@ -290,19 +290,33 @@ def io_name
290290
end
291291

292292
failure_message do |actual|
293+
dump_opts = {
294+
standard_prefixes: true,
295+
literal_shorthand: false,
296+
validate: false,
297+
base_uri: @info.base,
298+
prefixes: @info.prefixes
299+
}
293300
info = @info.respond_to?(:information) ? @info.information : @info.inspect
294301
if @expected.is_a?(RDF::Enumerable) && @actual.size != @expected.size
295302
"Graph entry counts differ:\nexpected: #{@expected.size}\nactual: #{@actual.size}\n"
296303
else
297304
"Graphs differ\n"
298305
end +
299306
"\n#{info + "\n" unless info.empty?}" +
300-
"Expected:\n#{@expected.dump(@info.format, standard_prefixes: true, literal_shorthand: false, validate: false) rescue @expected.inspect}" +
301-
"Results:\n#{@actual.dump(@info.format, standard_prefixes: true, literal_shorthand: false, validate: false) rescue @actual.inspect}" +
307+
"Expected:\n#{@expected.dump(@info.format, **dump_opts) rescue @expected.inspect}" +
308+
"Results:\n#{@actual.dump(@info.format, **dump_opts) rescue @actual.inspect}" +
302309
"\nDebug:\n#{@info.logger}"
303310
end
304311

305312
failure_message_when_negated do |actual|
313+
dump_opts = {
314+
standard_prefixes: true,
315+
literal_shorthand: false,
316+
validate: false,
317+
base: @info.base,
318+
prefixes: @info.prefixes
319+
}
306320
format = case
307321
when RDF.const_defined?(:TriG) then :trig
308322
when RDF.const_defined?(:Turtle) then :ttl
@@ -311,7 +325,7 @@ def io_name
311325
info = @info.respond_to?(:information) ? @info.information : @info.inspect
312326
"Graphs identical\n" +
313327
"\n#{info + "\n" unless info.empty?}" +
314-
"Results:\n#{actual.dump(@info.format, standard_prefixes: true, literal_shorthand: false, validate: false) rescue @actual.inspect}" +
328+
"Results:\n#{actual.dump(@info.format, **dump_opts) rescue @actual.inspect}" +
315329
"\nDebug:\n#{@info.logger}"
316330
end
317331

rdf-spec.gemspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ Gem::Specification.new do |gem|
2020

2121
gem.required_ruby_version = '>= 2.4'
2222
gem.requirements = []
23-
gem.add_runtime_dependency 'rdf', '~> 3.1'
23+
gem.add_runtime_dependency 'rdf', '~> 3.1', '>= 3.1.8'
2424
gem.add_runtime_dependency 'awesome_print', '~> 1.8'
2525
gem.add_runtime_dependency 'rdf-isomorphic', '~> 3.1'
2626
gem.add_runtime_dependency 'rspec', '~> 3.9'
2727
gem.add_runtime_dependency 'rspec-its', '~> 1.3'
28+
gem.add_runtime_dependency 'rexml', '~> 3.2' # For Webmock
2829
gem.add_runtime_dependency 'webmock', '~> 3.7'
29-
gem.add_development_dependency 'yard' , '~> 0.9.20'
30+
gem.add_development_dependency 'yard' , '~> 0.9'
3031
gem.post_install_message = nil
3132
end

0 commit comments

Comments
 (0)