<commit_before>share_examples_for 'a Reader' do

  include DataObjectsSpecHelpers

  before :all do
    setup_test_environment
  end

  before :each do
    @connection = DataObjects::Connection.new(CONFIG.uri)
    @reader     = @connection.create_command("SELECT code, name FROM widgets WHERE ad_description = ? order by id").execute_reader('Buy this product now!')
  end

  after :each do
    @reader.close
    @connection.close
  end

  it { @reader.should respond_to(:fields) }

  describe 'fields' do

    it 'should return the correct fields in the reader' do
      @reader.fields.should == ['code', 'name']<commit_msg>[data_objects] Make spec disregard case of returned Reader fields<commit_after>share_examples_for 'a Reader' do

  include DataObjectsSpecHelpers

  before :all do
    setup_test_environment
  end

  before :each do
    @connection = DataObjects::Connection.new(CONFIG.uri)
    @reader     = @connection.create_command("SELECT code, name FROM widgets WHERE ad_description = ? order by id").execute_reader('Buy this product now!')
  end

  after :each do
    @reader.close
    @connection.close
  end

  it { @reader.should respond_to(:fields) }

  describe 'fields' do

    it 'should return the correct fields in the reader' do
      # we downcase the field names as some drivers such as do_derby, do_h2,
      # do_hsqldb return the field names as uppercase
      @reader.fields.map{ |f| f.downcase }.should == ['code', 'name']
{'fraction_non_alphanumeric': 0.09084652443220922, 'fraction_numerical': 0.0006882312456985547, 'mean_word_length': 3.736156351791531, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2760742', 'n_tokens_mistral': 443, 'n_tokens_neox': 420, 'n_words': 141}