Sha256: 683b3197fe828eb018826816d05312ecb470874e137975181b39dd7a25e924c1

Contents?: true

Size: 938 Bytes

Versions: 5

Compression:

Stored size: 938 Bytes

Contents

require File.join(File.dirname(__FILE__), 'helper')

class LineTest < MiniTest::Unit::TestCase

  def setup
    @diff = new_diff(fixture('first.diff'))
    @lines = @diff.chunks.last.lines
  end

  def test_contents
    assert_equal "     color: #999;", strip_word_indicators(@lines[0].contents)
    assert_equal "-  table.account-overview td .status {", strip_word_indicators(@lines[3].contents)
    assert_equal "+  table.account-overview td.label.top {", strip_word_indicators(@lines[4].contents)
    assert_equal "   }", strip_word_indicators(@lines.last.contents)
  end

  def test_ignored
    line = PrettyDiff::Line.new(@diff, '\ No newline at end of file')
    assert line.ignored?
  end

  def test_status_added
    assert_equal :added, @lines[4].status
  end

  def test_status_deleted
    assert_equal :deleted, @lines[3].status
  end

  def test_status_not_modified
    assert_equal :not_modified, @lines[0].status
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pretty_diff-2.1.4 test/line_test.rb
pretty_diff-2.1.3 test/line_test.rb
pretty_diff-2.1.2 test/line_test.rb
pretty_diff-2.1.1 test/line_test.rb
pretty_diff-2.1.0 test/line_test.rb