Sha256: 7335e5b2b75e9dcf99e5a85628cf2157c2ff2a1c43139f092ace70a87eacd35e

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 KB

Contents

require 'rspec'
require File.dirname(__FILE__) + "/../lib/" + "gherkin_repo"

describe "cql" do
  describe "select" do
    it 'should find the feature file names' do
      gs = CQL::GherkinRepository.new File.dirname(__FILE__) + "/../fixtures/features/simple"

      result = gs.query do
        select names
        from features
      end

      result.should == ["Simple", "Test Feature", "Test2 Feature", "Test3 Feature"]
    end

    it 'should find the feature file names' do
      gs = CQL::GherkinRepository.new File.dirname(__FILE__) + "/../fixtures/features/simple"

      result = gs.query do
        select uri
        from features
      end

      result[0].should =~ /simple\.feature/
      result[1].should =~ /test\.feature/
      result[2].should =~ /test2\.feature/
      result[3].should =~ /test_full\.feature/
    end

    it 'should get scenario outlines as a list' do
      gs = CQL::GherkinRepository.new File.expand_path(File.dirname(__FILE__)) + "/../fixtures/features/scen_outlines"

      result = gs.query do
        select names
        from scenario_outlines
      end

      result.should == ["An Outline"]
    end

    it 'should get scenario as a list' do
      gr = CQL::GherkinRepository.new File.expand_path(File.dirname(__FILE__)) + "/../fixtures/features/simple2"

      result = gr.query do
        select names
        from scenarios
      end

      result.should == ["Testing the slurping", "Testing again", "Testing yet again", "Testing yet again part 2"]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cql-0.0.1 spec/select_dsl_spec.rb