test/mayl/env_test.rb in mayl-0.1.0 vs test/mayl/env_test.rb in mayl-0.2.0

- old
+ new

@@ -1,11 +1,11 @@ require 'test_helper' module Mayl describe Env do before do - @locales = [stub, stub] + @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 @@ -16,9 +16,17 @@ @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