<commit_before># encoding: UTF-8

require 'spec_helper'

describe Morpher::Evaluator::Transformer::Map do
  let(:object) { described_class.new(operand) }

  context '#intransitive' do
    let(:operand) { Morpher.evaluator(s(:attribute, :length)) }

    include_examples 'transforming evaluator'
    include_examples 'intransitive evaluator'
    include_examples 'no invalid input'

    let(:valid_input)     { [ 'foo' ] }
    let(:expected_output) { [ 3 ]     }
  end

  context '#transitive' do
    let(:operand) { Morpher.evaluator(s(:guard, s(:primitive, String))) }

    include_examples 'transforming evaluator'
    include_examples 'transitive evaluator'
    include_examples 'no invalid input'

    let(:valid_input)     { [ 'foo' ] }
    let(:invalid_input)   { [ nil   ] }
    let(:expected_output) { [ 'foo' ] }
  end

end<commit_msg>Fix style complains by rubocop<commit_after># encoding: UTF-8

require 'spec_helper'

describe Morpher::Evaluator::Transformer::Map do
  let(:object) { described_class.new(operand) }

  context '#intransitive' do
    let(:operand) { Morpher.evaluator(s(:attribute, :length)) }

    include_examples 'transforming evaluator'
    include_examples 'intransitive evaluator'
    include_examples 'no invalid input'

    let(:valid_input)     { ['foo'] }
    let(:expected_output) { [3]     }
  end

  context '#transitive' do
    let(:operand) { Morpher.evaluator(s(:guard, s(:primitive, String))) }

    include_examples 'transforming evaluator'
    include_examples 'transitive evaluator'
    include_examples 'no invalid input'

    let(:valid_input)     { ['foo'] }
    let(:invalid_input)   { [nil]   }
    let(:expected_output) { ['foo'] }
  end

end
{'fraction_non_alphanumeric': 0.12979351032448377, 'fraction_numerical': 0.002359882005899705, 'mean_word_length': 4.002949852507375, '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': '1455946', 'n_tokens_mistral': 569, 'n_tokens_neox': 542, 'n_words': 115}