Sha256: 1dee1c5a4a593708010aaa012d5b774135e4f8e568ee6a05e5a0576f4f8373fc

Contents?: true

Size: 903 Bytes

Versions: 4

Compression:

Stored size: 903 Bytes

Contents

require "#{File.dirname(__FILE__)}/../spec_helper"


describe 'an object that uses the DSL' do


  let(:nodule) { CQL::Dsl }
  let(:dsl_enabled_object) { Object.new.extend(nodule) }


  describe "transform" do

    describe "multiple targets" do

      it 'does not apply more transforms than have been declared' do
        gs = CQL::Repository.new("#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/simple")

        results = gs.query do
          select :self, :self, :self
          as thing1, thing2, thing3
          from scenarios
          transform :self => lambda { |thing1| 1 }
          transform :self => lambda { |thing2| 2 }
        end

        expect(results.first).to include('thing1' => 1, 'thing2' => 2)
        expect(results.first).to_not include('thing3' => 1)
        expect(results.first).to_not include('thing3' => 2)
      end

    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cql-1.7.0 testing/rspec/spec/clauses/transform_clause_spec.rb
cql-1.6.0 testing/rspec/spec/clauses/transform_clause_spec.rb
cql-1.5.1 testing/rspec/spec/clauses/transform_clause_spec.rb
cql-1.5.0 testing/rspec/spec/clauses/transform_clause_spec.rb