<commit_before>
#
# specifying flor
#
# Sat Feb 16 12:00:00 JST 2019
#

require 'spec_helper'


describe 'Flor unit' do

  class HlAliceTasker < Flor::BasicTasker

    def task

      payload['ret'] = 'Alice was here'

      reply
    end
  end

  before :each do

    @unit = Flor::Unit.new(
      loader: Flor::HashLoader,
      sto_uri: RUBY_PLATFORM.match(/java/) ?
        'jdbc:sqlite://tmp/test.db' : 'sqlite::memory:')
    @unit.conf['unit'] = 'unit_hloader'
    #@unit.hook('journal', Flor::Journal)
    @unit.storage.delete_tables
    @unit.storage.migrate
    @unit.start
  end

  after :each do

    @unit.shutdown
  end

  describe 'with hloader' do

    describe '#add_var' do

      {
        [ { 'age' => 20 } ] => 20,
        [ { 'age' => 20 }, 'org.example' ] => 20,<commit_msg>Slow down unit_hloader_spec.rb<commit_after>
#
# specifying flor
#
# Sat Feb 16 12:00:00 JST 2019
#

require 'spec_helper'


describe 'Flor unit' do

  class HlAliceTasker < Flor::BasicTasker

    def task

      payload['ret'] = 'Alice was here'

      reply
    end
  end

  before :each do

    @unit = Flor::Unit.new(
      loader: Flor::HashLoader,
      sto_uri: RUBY_PLATFORM.match(/java/) ?
        'jdbc:sqlite://tmp/test.db' : 'sqlite::memory:')
    @unit.conf['unit'] = 'unit_hloader'
    #@unit.hook('journal', Flor::Journal)
    @unit.storage.delete_tables
    @unit.storage.migrate
    @unit.start

    sleep 0.770
  end

  after :each do

    @unit.shutdown
  end

  describe 'with hloader' do

    describe '#add_var' do

      {
        [ { 'age' => 20 } ] => 20,
        [ { 'age' => 20 }, 'org.example' ] => 20,
{'fraction_non_alphanumeric': 0.14760147601476015, 'fraction_numerical': 0.02706027060270603, 'mean_word_length': 2.4914163090128754, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6320251', 'n_tokens_mistral': 657, 'n_tokens_neox': 581, 'n_words': 133}