2.0 Beta Release
Pre-release
Pre-release
Updates for RDF.rb 2.0 Beta
- Specs for
Queryable#querytested internal implementation rather than behavior, this caused issues for classes mixing inQueryable, but delegating#queryto some collaborator. See, e.g. ActiveTriples/ActiveTriples#169. This tests the contract directly, instead. - Add tests for Transaction, Changeset, and Dataset
- Refactor
Queryablespecs- #33 created some duplicate tests; this refactors by moving them into a shared example set.
- Additionally, it skips specs for
#query_patternand#query_executeif they are not defined by theQueryable. This allows implementations to fulfill the#queryinterface directly, if desired.
- Disable an enumerable test unless the subject supports named graphs. (Moved some other checks inside the spec, where it's defined).
- In Mutable, when doing deletes with patterns, make sure to not use BNodes, which might not be supported by repository implementation.
- Add
RDF::Spec.logger, which creates a Logger instance using a StringIO. Also implements#clearand#to_sinstance methods. - Added
be_equivalent_graphandproducematchers. - Simplify
Enumerable#has_statement?spec as both Repositories and Graphs should have a statement, either matching on graph_name, or ignoring it. Previously, if a Graph had a boundgraph_nameit would need to match that in the statement, but this is inconsistent with the notion that a graph has only triples. - Change Queryable#first_* specs to not depend on query result ordering.
- Add a round-trip check for Writers also having a Reader to ensure that different BNodes having the same identifier get written out with unique identifiers (see ruby-rdf/rdf/issues/262).
- Soften RDF::Transaction buffering requirements
- Not every
Transactionneeds to keep an up-to-dateChangesetin buffer. This change loosens the requirements. some of the tests are removed to therdftest suite inspec/transaction_spec.rb. - Introduce
RDF::Datasetas a distinct conceptDatasetis introduced as a base class ofRDF::Repository. It represents a (default read only) set of graphs. Some of the specs are removed from the repository specs, but are re-included indirectly through dataset's tests.
- Test atomic/transactional #delete_insert application
- When a Mutable
#supports?(:transactions),#delete_insertis guaranteed to update atomically. Repository#delete_insertalways applies within a transaction scope and conforms to the individual Repository`s transaction semantics.
- When a Mutable
- Check durability by re-creating the repository using
uriand verifying that when subject is updated, the new instance is also updated. Fixes #52. - Skip mutable and writable tests unless resource is mutable or writable. This is better than testing separately in each test.
- Avoid changing Repository while tx is in progress
- Adding or deleting statements in the Repository causes serializable transactions to break (correctly). Instead, prepare the repository state before beginning the test transaction.
- Test isolation semantics for transactions.