Sha256: 1218923037604b27eb16cf5e7bd65d997b405723b655718333a0b24d8b374e64

Contents?: true

Size: 650 Bytes

Versions: 2

Compression:

Stored size: 650 Bytes

Contents

require 'test_helper'

module Mayl
  describe Env do
    before do
      @locales = [stub(peek: [:baz]), stub(peek: [:bar])]
      Loader.expects(:load).with('my/path').returns @locales
      @env = Mayl::Env.new('my/path')
    end

    it 'is a container for locales' do
      @env.locales.must_equal @locales
    end

    it 'commits changes to disk' do
      @locales.each do |locale|
        locale.expects(:commit)
      end

      @env.commit
    end

    it 'peeks in the locales' do
      @env.peek.must_equal [:baz, :bar]
    end

    it 'autocompletes from a key' do
      @env.autocomplete('ba').must_equal [:baz, :bar]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mayl-0.2.1 test/mayl/env_test.rb
mayl-0.2.0 test/mayl/env_test.rb