Sha256: 9b55619544aa486d81ea6ce33cab208fc7e8ed43dd2bd5cf186b7ca562fcbb2d

Contents?: true

Size: 983 Bytes

Versions: 1

Compression:

Stored size: 983 Bytes

Contents

require File.join(File.expand_path(File.dirname(__FILE__)), 'testutilities')
require File.expand_path(File.join(File.dirname(__FILE__), "../lib/amp"))

class OppositeMethodTestKlass
  def base(input)
    !!input
  end
  opposite_method :opposite, :base
end

class TestSupport < AmpTestCase
  def test_split_newlines
    assert_equal(["hi there what's\n", "\r up there\r kids\n", " lol"], "hi there what's\n\r up there\r kids\n lol".split_newlines)
  end
  
  def test_absolute
    root = "/root"
    paths = { "/Monkey"  => "/Monkey",
              "asd/asdf" => "/root/asd/asdf",
              "bllop"    => "/root/bllop"
            }
    
    paths.each do |path, result|
      assert_equal result, path.absolute(root)
    end
  end
  
  def test_opposite_method
    obj = OppositeMethodTestKlass.new
    assert_respond_to obj, :opposite
    assert obj.base(true)
    assert_false obj.opposite(true)
    assert_false obj.base(false)
    assert obj.opposite(false)
  end
  
end



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
amp-0.5.3 test/test_support.rb