Sha256: ade7fd976474a0a7fb42c558af97b71859106b0a334991aa6ebea10c0611bd44

Contents?: true

Size: 550 Bytes

Versions: 3

Compression:

Stored size: 550 Bytes

Contents

require 'spec_helper'

describe Itiel::Extract::CustomSQL do
  describe "#extract" do
    before :each do
      @step = Itiel::Extract::CustomSQL.new 'SCRIPT'
      @step.connection = :test
    end

    it "Runs a script on the database and returns its results to the stream" do
      result = double
      allow(result).to receive(:all).and_return double
      db = { 'SCRIPT' => result }
      allow(Itiel::Extract::CustomSQL).to receive(:sequel_connection).with(:test).and_return db

      expect(@step.extract).to eq result.all
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
itiel-0.1.2 spec/extract/custom_sql_spec.rb
itiel-0.1.1 spec/extract/custom_sql_spec.rb
itiel-0.1.0 spec/extract/custom_sql_spec.rb