Sha256: 2ce5386de408ca486ea2b94f301158bc579a8bd83fb4f77c38de6292cbe2f70a

Contents?: true

Size: 854 Bytes

Versions: 2

Compression:

Stored size: 854 Bytes

Contents

require 'test_helper'

class FromHereTest < Test::Unit::TestCase
  context 'the FromHere module' do
    should 'have a from_here method' do
      assert FromHere.respond_to?(:from_here)
    end

    context 'from_here method' do
      should 'fail without a block' do

      end
      should 'find this test file' do
        this_file = File.join(File.dirname(__FILE__), File.basename(__FILE__))
        found_file = FromHere.from_here(File.basename(__FILE__)){}
        assert_equal this_file, found_file
      end

      should 'find another file' do
        load FromHere.from_here('fixtures','canary.rb'){}
        assert_respond_to Canary, :tweet
      end

      should 'raise a very specific error when called without a block' do
        assert_raise FromHere::NoBlockError do
          FromHere::from_here
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
bkerley-from-here-0.1.0 test/from_here_test.rb
from-here-0.1.0 test/from_here_test.rb