<commit_before>require File.expand_path('../test_helper', __FILE__)

class DiffTest < Test::Unit::TestCase

  def setup
    @diff_value = 'test'
    @diff_value_was = 'testing'
    @diff = SubDiff::Diff.new(@diff_value, @diff_value_was)
    @diff_without_value_was = SubDiff::Diff.new(@diff_value)
  end

  def test_initialize_with_value_was
    assert_equal @diff_value, @diff.value
    assert_equal @diff_value_was, @diff.value_was
  end

  def test_initialize_without_value_was
    assert_equal @diff_value, @diff_without_value_was.value
    assert_equal @diff_without_value_was.value, @diff_without_value_was.value_was
  end

  def test_changed?
    assert @diff.changed?
    assert !@diff_without_value_was.changed?
    assert !SubDiff::Diff.new('test', 'test').changed?
  end

  def test_method_missing
    assert_equal @diff_value.upcase, @diff.upcase
    assert_raises(NoMethodError) { @diff.invalid_method }
  end

  def test_to_s
    assert_equal @diff.value, @diff.to_s
  end

end<commit_msg>move DiffTest under SubDiff namespace<commit_after>require File.expand_path('../test_helper', __FILE__)

module SubDiff
  class DiffTest < Test::Unit::TestCase
    def setup
      @diff_value = 'test'
      @diff_value_was = 'testing'
      @diff = Diff.new(@diff_value, @diff_value_was)
      @diff_without_value_was = Diff.new(@diff_value)
    end

    def test_initialize_with_value_was
      assert_equal @diff_value, @diff.value
      assert_equal @diff_value_was, @diff.value_was
    end

    def test_initialize_without_value_was
      assert_equal @diff_value, @diff_without_value_was.value
      assert_equal @diff_without_value_was.value, @diff_without_value_was.value_was
    end

    def test_changed?
      assert @diff.changed?
      assert !@diff_without_value_was.changed?
      assert !Diff.new('test', 'test').changed?
    end

    def test_method_missing
      assert_equal @diff_value.upcase, @diff.upcase
      assert_raises(NoMethodError) { @diff.invalid_method }
    end

    def test_to_s
      assert_equal @diff.value, @diff.to_s
    end
  end
end
{'fraction_non_alphanumeric': 0.0905587668593449, 'fraction_numerical': 0.0, 'mean_word_length': 4.04126213592233, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7614096', 'n_tokens_mistral': 710, 'n_tokens_neox': 698, 'n_words': 128}