Sha256: 23e9616b448bd5cb32ca18a0202aed4bb7b474ee6dfc03e0b0b9a7355ec56007

Contents?: true

Size: 611 Bytes

Versions: 1

Compression:

Stored size: 611 Bytes

Contents

require 'helper'
require 'stringio'

class TestAssertions < Test::Unit::TestCase
  include LineByLine::Assertions
  
  def test_nothing_raises
    assert_same_buffer "foo", "foo"
  end
  
  class Refuter
    include LineByLine::Assertions
    
    attr_reader :m
    def flunk(m)
      @m = m
    end
    
    def perform
      assert_same_buffer "foo\nbar\nbaz", "foo\nbar", "Total fail"
    end
  end
  
  def test_not_same
    r = Refuter.new
    message = 'Total fail
Lines have different lengths (4 expected, but was 3) at line 2
 + "bar\n"
 - "bar"'

    r.perform
    assert_equal message, r.m
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
linebyline-1.0.0 test/test_assertions.rb