Sha256: 792b33120686c7fdae0fdac208b0280399aa974772f001f47024c39b379fa911

Contents?: true

Size: 753 Bytes

Versions: 1

Compression:

Stored size: 753 Bytes

Contents

require 'spec_helper'
require 'conceptql/operators/concept'

describe ConceptQL::Operators::Concept do
  it_behaves_like(:evaluator)

  class ConceptDouble < ConceptQL::Operators::Concept
    attr_accessor :cql_query

    def arguments
      [1]
    end

    def set_statement(value)
      @statement = { icd9: '412' }
    end

    def set_cql_query(db)
      @cql_query ||= nil
    end

    def cql_query
      set_cql_query(nil)
    end
  end

  describe '#query' do
    it 'evaluates upstream' do
      cd = ConceptDouble.new(1)
      db = Sequel.mock
      cd.cql_query = double("query")
      expect(cd.cql_query).to receive(:query).and_return(cd.cql_query)
      expect(cd.cql_query).to receive(:from_self)
      cd.query(db)
    end
  end
end



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
conceptql-0.2.0 spec/conceptql/operators/concept_spec.rb