Sha256: b35454664cf4fda53c855a4bb07f3f9b3462382fe2e6aed5de06f4467c90271b

Contents?: true

Size: 627 Bytes

Versions: 6

Compression:

Stored size: 627 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'

RSpec::Matchers.define :be_a_relation_containing do |*expected|
  match do |actual|
    expect(actual.class).to eq ActiveTriples::Relation

    actual_terms = actual.map   { |i| i.respond_to?(:to_term) ? i.to_term : i }
    exp_terms    = expected.map { |i| i.respond_to?(:to_term) ? i.to_term : i }

    expect(actual_terms).to contain_exactly(*exp_terms)
    true
  end
end

RSpec::Matchers.define :have_rdf_subject do |expected|
  match do |actual|
    expect(actual).to be_a ActiveTriples::RDFSource
    expect(actual.to_term).to eq expected.to_term
    true
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
active-triples-1.2.0 spec/support/matchers.rb
active-triples-1.1.1 spec/support/matchers.rb
active-triples-1.1.0 spec/support/matchers.rb
active-triples-1.0.0 spec/support/matchers.rb
active-triples-1.0.0.rc1 spec/support/matchers.rb
active-triples-0.11.0 spec/support/matchers.rb