Sha256: ac2ee09511017fcb559ca2518fbc387eb0baef9320ed664ab44bbb9c569354fc

Contents?: true

Size: 627 Bytes

Versions: 4

Compression:

Stored size: 627 Bytes

Contents

require 'spec_helper'

describe Cql::Model::QueryResult do
  before :all do
    Cql::Base.establish_connection(host: '127.0.0.1')
    Cql::Base.connection.use('cql_model_test')
  end

  let(:empty_result) do
    query = 'SELECT * FROM events'
    result = Cql::Base.connection.execute(query)
    Cql::Model::QueryResult.new(result, Event)
  end

  let(:full_result) do
    query = 'SELECT * FROM people'
    result = Cql::Base.connection.execute(query)
    Cql::Model::QueryResult.new(result, Person)
  end

  describe '#empty?' do
    it { full_result.empty?.must_equal false }
    it { empty_result.must_be_empty }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cql_model-0.0.5 spec/cql/model/query_result_spec.rb
cql_model-0.0.4 spec/cql/model/query_result_spec.rb
cql_model-0.0.3 spec/cql/model/query_result_spec.rb
cql_model-0.0.2 spec/cql/model/query_result_spec.rb