Sha256: 7d45d3908a0bf2843752a6739007bfad4d36b93de8f9f8f939bf1dfcbe85876e

Contents?: true

Size: 701 Bytes

Versions: 3

Compression:

Stored size: 701 Bytes

Contents

module Adhoq
  RSpec.describe Executor, type: :model do
    context 'create xlsx report' do
      let(:executor) do
        Executor.new('SELECT 42 AS answer')
      end

      specify { expect(executor.execute).to eq Adhoq::Result.new(%w[answer], [[42]]) }
    end

    describe '.select' do
      specify 'Do not reflect write access' do
        expect {
          Executor.select(<<-INSERT_SQL.strip_heredoc)
            INSERT INTO "adhoq_queries"
            ("description", "name", "query", "updated_at", "created_at")
            VALUES
            ("description", "name", "SELECT 1", "NOW", "NOW")
          INSERT_SQL
        }.not_to change(Adhoq::Query, :count)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adhoq-0.0.5 spec/adhoq/executor_spec.rb
adhoq-0.0.4 spec/adhoq/executor_spec.rb
adhoq-0.0.3 spec/adhoq/executor_spec.rb