Sha256: d2c14b772fe7fbe0c679e146278a7b6bb3c0ff1cfe43698a1cdd9687166503f4

Contents?: true

Size: 932 Bytes

Versions: 5

Compression:

Stored size: 932 Bytes

Contents

module TestFactories
  module Graph
    def self.factory_for
      ::Dbd::Graph
    end

    def self.new_subject
      Dbd::Fact.factory.new_subject
    end

    def self.full
      Dbd::Graph.new.tap do |graph|
        context_subject = new_subject
        visibility_context_fact = Dbd::ContextFact.new(
          subject: context_subject,
          predicate: 'context:visibility',
          object_type: 's',
          object: 'public')
        created_context_fact = Dbd::ContextFact.new(
          subject: context_subject,
          predicate: 'dcterms:created',
          object_type: 's',
          object: '2013-10-13')
        fact = Dbd::Fact.new(
          subject: new_subject,
          context_subject: context_subject,
          predicate: 'fact_predicate',
          object_type: 's',
          object: 'whooha')
        graph << visibility_context_fact << created_context_fact << fact
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dbd_data_engine-0.0.10 spec/test_factories/graph.rb
dbd_data_engine-0.0.9 spec/test_factories/graph.rb
dbd_data_engine-0.0.8 spec/test_factories/graph.rb
dbd_data_engine-0.0.7 spec/test_factories/graph.rb
dbd_data_engine-0.0.6 spec/test_factories/graph.rb