Sha256: c5ce79c4bb830d2af13cb52414a68bbe6fab117dfb4ca89196c1885784ef641d

Contents?: true

Size: 815 Bytes

Versions: 4

Compression:

Stored size: 815 Bytes

Contents

require_relative '../../spec_helper'
require 'sql/maker/select'

begin
  fname = "#{ROOT}/doc/sql/maker/select.md"
  file = File.open(fname)
  lineno = 0
  while line = file.gets
    lineno += 1
    break if line =~ /=head1/
  end
  code = ''
  describe 'SQL::Maker::Select' do
    it do
      while line = file.gets
        lineno += 1
        next if line =~ /^ *#/
        if line =~ /^[ ]{4,}.*# => (.+)/
          # puts "----------------------"
          # puts code
          expected = eval($1, binding)
          got = eval(code, binding, fname, lineno - 4)
          got.gsub!(/\n/, ' ')
          got.gsub!(/ +$/, '')
          expect(got).to be == expected
        elsif line =~ /^[ ]{4,}(.+)/
          code += "#{$1}\n"
        else
          code = '' # clear
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sql-maker-1.0.0 spec/maker/select/pod_select_spec.rb
sql-maker-0.0.5 spec/maker/select/pod_select_spec.rb
sql-maker-0.0.4 spec/maker/select/pod_select_spec.rb
sql-maker-0.0.3 spec/maker/select/pod_select_spec.rb