Sha256: a399d10a31b9ebe72845bcc60976742ddae4c4d43f5d914b781365c00c7d303f

Contents?: true

Size: 790 Bytes

Versions: 12

Compression:

Stored size: 790 Bytes

Contents

##
# Shared context for activities that enumerate their generated entities.
#
# To use, define in your example:
#   - generator_uri [String] URI that corresponds to the ID of your activity
#
shared_context 'provenance queries' do
  let(:query) { double('RDF::Query') }
  let(:solution) { double('RDF::Query::Solution') }
  let(:solution_enum) do
    Enumerator.new do |e|
      e.yield solution
    end
  end
  let(:uri) { double('result uri') }

  before do
    allow(Krikri::ProvenanceQueryClient).to receive(:find_by_activity)
      .with(RDF::URI(generator_uri), false).and_return(query)
    allow(query).to receive(:execute).and_return([solution])
    allow(query).to receive(:each_solution).and_return(solution_enum)
    allow(solution).to receive(:record).and_return(uri)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
krikri-0.15.2 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.15.1 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.15.0 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.14.0 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.13.2 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.13.1 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.13.0 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.12.4 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.12.3 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.12.1 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.12.0 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.12.0.pre.rc.1 spec/support/shared_contexts/provenance_query_client.rb