Sha256: 629e753b6066108620d41fcc79cdfc454f5547dce6a8e49e6a955ab9bbdcef2c

Contents?: true

Size: 846 Bytes

Versions: 2

Compression:

Stored size: 846 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;", @lines[0].contents
    assert_equal "-  table.account-overview td .status {", @lines[3].contents
    assert_equal "+  table.account-overview td.label.top {", @lines[4].contents
    assert_equal "   }", @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

2 entries across 2 versions & 1 rubygems

Version Path
pretty_diff-2.0.1 test/line_test.rb
pretty_diff-2.0.0 test/line_test.rb