View on GitHub

Rdf-spec

RDF.rb plugin that provides RSpec matchers and shared examples for RDF objects.

Download this project as a .zip file Download this project as a tar.gz file

RSpec Extensions for RDF.rb

This is an RDF.rb plugin that provides RDF-specific RSpec matchers and shared examples for Ruby projects that use RDF.rb and RSpec.

Gem Version

Documentation

Shared specs are implemented in modules which typically require that an instance be defined in a class variable in a before(:each) block. For example, an class implementing RDF::Countable could test this behavior by defining @countable as an instance variable and including RDF_Countable as follows:

describe RDF::Enumerable do
  before :each do
    # The available reference implementations are `RDF::Repository` and
    # `RDF::Graph`, but a plain Ruby array will do fine as well:
    @enumerable = RDF::Spec.quads.dup.extend(RDF::Enumerable)
  end

  # @see lib/rdf/spec/enumerable.rb in rdf-spec
  include RDF_Enumerable
end

Note that in most cases, if the instance is empty and mutable, the appropriate statements will be added. When testing a non-mutable instance, the data must be pre-loaded.

Dependencies

Installation

The recommended installation method is via RubyGems. To install the latest official release of the RDF::Spec gem, do:

% [sudo] gem install rdf-spec

Download

To get a local working copy of the development repository, do:

% git clone git://github.com/ruby-rdf/rdf-spec.git

Alternatively, download the latest development version as a tarball as follows:

% wget http://github.com/ruby-rdf/rdf-spec/tarball/master

Authors

Contributors

Contributing

License

This is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying {file:UNLICENSE} file.