<commit_before>require 'rubygems'
Bundler.setup :test

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'tanker'
require 'rspec'

Rspec.configure do |c|
  c.mock_with :rspec
end

Tanker.configuration = {:url => 'http://api.indextank.com'}

class Dummy

end

$frozen_moment = Time.now

class Person
  include Tanker

  tankit 'people' do
    indexes :name
    indexes :last_name
    index_variables do
      {0 => 1.0,
       1 => 20.0,
       2 => 300.0}
    end
  end

  def created_at
    $frozen_moment
  end

  def id
    1
  end

  def name
    'paco'
  end

  def last_name
    'viramontes'
  end
end

class Dog
  include Tanker

  tankit 'animals' do
    indexes :name
  end

end

class Cat
  include Tanker

  tankit 'animals' do
    indexes :name
  end
<commit_msg>spec helper classes have attributes<commit_after>require 'rubygems'
Bundler.setup :test

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'tanker'
require 'rspec'

Rspec.configure do |c|
  c.mock_with :rspec
end

Tanker.configuration = {:url => 'http://api.indextank.com'}

class Dummy

end

$frozen_moment = Time.now

class Person

  attr_accessor :name, :last_name

  def initialize(attrs = {})
    attrs.each {|k,v| self.send "#{k}=", v }
    self.name ||= 'paco'
    self.last_name ||= 'viramontes'
  end

  include Tanker

  tankit 'people' do
    indexes :name
    indexes :last_name
    index_variables do
      {0 => 1.0,
       1 => 20.0,
       2 => 300.0}
    end
  end

  def created_at
    $frozen_moment
  end

  def id
    1
  end
end

class Dog
  include Tanker

  tankit 'animals' do
    indexes :name
  end

end

class Cat
  include Tanker

  tankit 'animals' do
    indexes :name
  end

{'fraction_non_alphanumeric': 0.11117226197028068, 'fraction_numerical': 0.014309301045679693, 'mean_word_length': 2.8680851063829786, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '615515', 'n_tokens_mistral': 735, 'n_tokens_neox': 699, 'n_words': 179}