Sha256: 643264c2cca37f8cd005ad03d8b1a289ddb26cf1c9d91e4f5d6113bc52f78f5f

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

require "./test/tests_helper"
require "nele-cli"

module Nele
  describe "Config" do
    def subject
      cleanup
      Config.create filepath
      @subject ||= Config.new filepath
    end

    it "creates config file if doesn't exist" do
      cleanup
      File.exist?(filepath).must_equal false
      Config.create(filepath)
      File.exist?(filepath).must_equal true
    end

    describe "#init" do
      it 'catches exception when config file not found' do
        YAML.stubs(:load_file).raises Errno::ENOENT
        subject.load_file
      end
    end

    describe '#params' do
      it 'has /translators/ key' do
        subject.params.has_key?(:translators).must_equal true
      end

      it 'has /default/ key' do
        subject.params.has_key?(:default).must_equal true
      end
    end

    describe '#translators' do
      it 'has /ms/ key' do
        subject.translators.has_key?(:ms).must_equal true
      end

      it 'has /babelfish/ key' do
        subject.translators.has_key?(:babelfish).must_equal true
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nele-cli-0.2.1 test/config_test.rb