<commit_before>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

require 'digest/md5'

module Mrg
  module Grid
    module Config

      describe Node do
        before(:each) do
          setup_rhubarb
          @store = Store.new
          reconstitute_db
        end
        
        after(:each) do
          teardown_rhubarb
        end
        
        include BaseDBFixture

        [["int", "0001234567890"], ["float", "1.100"]].each do |kind, expected_val|
          it "should not convert string parameter values to #{kind}s, even if they look like #{kind}s" do
            @store.addParam("FOO")
            ff = @store.addExplicitGroup("Foo Floaters")
            ff.modifyParams("ADD", {"FOO"=>expected_val}, {})
            ff.getConfig["FOO"].should == expected_val
          end
        end
      end
    end
  end
end<commit_msg>A few more type-sniffing examples<commit_after>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

require 'digest/md5'

module Mrg
  module Grid
    module Config

      describe Node do
        before(:each) do
          setup_rhubarb
          @store = Store.new
          reconstitute_db
        end
        
        after(:each) do
          teardown_rhubarb
        end
        
        include BaseDBFixture

        [["octal int", "017"], ["hexadecimal int", "0xdefaced"], ["int", "0001234567890"], ["float", "1.100"], ["bizarre intlike substance", "01.10.01.10"]].each do |kind, expected_val|
          it "should not convert string parameter values to #{kind}s, even if they look like #{kind}s" do
            @store.addParam("FOO")
            ff = @store.addExplicitGroup("Foo Floaters")
            ff.modifyParams("ADD", {"FOO"=>expected_val}, {})
            ff.getConfig["FOO"].should == expected_val
          end
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.11471861471861472, 'fraction_numerical': 0.025974025974025976, 'mean_word_length': 2.0868113522537564, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '3502076', 'n_tokens_mistral': 592, 'n_tokens_neox': 553, 'n_words': 141}