Sha256: 9fa33ffcc4e7d8868d7677beadccffd417c51e4d993e1f0534928bf05a94168d

Contents?: true

Size: 783 Bytes

Versions: 32

Compression:

Stored size: 783 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)).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

32 entries across 32 versions & 1 rubygems

Version Path
krikri-0.7.2 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.7.1 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.7.0 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.6.0 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.5.7 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.5.6 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.5.5 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.5.4 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.5.3 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.5.2 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.5.1 spec/support/shared_contexts/provenance_query_client.rb
krikri-0.5.0 spec/support/shared_contexts/provenance_query_client.rb