Sha256: e035db68ddfeafa38d6ccaf50e7e4d5dd3bd904bb2ced30bfc8094617562b911

Contents?: true

Size: 928 Bytes

Versions: 1

Compression:

Stored size: 928 Bytes

Contents

require 'helper'

class TestYamlDriver < Test::Unit::TestCase
  context 'yaml driver' do
    setup do
      @base = File.expand_path('../fixtures', __FILE__)
    end

    should 'throw exception if path option is not parsed in' do
      assert_raise FatalException do
        Jekyll::Drivers::YamlDriver.new({})
      end
    end

    should 'throw exception if path option is nil' do
      assert_raise Jekyll::FatalException do
        Jekyll::Drivers::YamlDriver.new('path' => nil)
      end
    end

    should 'throw exception if file does not exist' do
      assert_raise FatalException do
        Jekyll::Drivers::YamlDriver.new('path' => 'nonexistfile')
      end
    end

    should 'load valid yaml file' do
      assert_nothing_raised FatalException do
        members = Jekyll::Drivers::YamlDriver.new('path' => File.join(@base, 'members.yaml')).load

        assert_equal members.size, 2
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
monad-0.0.3 test/test_yaml_driver.rb