Sha256: f5df639eefd87153303cbb16fd129d11efe76577030d31d9a2abe5d90dc0ecd4

Contents?: true

Size: 918 Bytes

Versions: 10

Compression:

Stored size: 918 Bytes

Contents

require "spec_helper"

module FastGettext
  module TranslationRepository
    class Dummy
      attr_accessor :name, :options
      def initialize(name, options)
        @name = name
        @options = options
      end
    end
  end
end

describe FastGettext::TranslationRepository do
  describe "build" do
    it "auto requires class by default" do
      lambda { FastGettext::TranslationRepository.build('xx', { :type => 'invalid'}) }.should raise_error(LoadError)
    end

    it "can have auto-require disabled" do
      FastGettext::TranslationRepository.build('xx', { :type => 'dummy' })
    end

    it "makes a new repository" do
      options = { :type => 'dummy', :external => true }
      repo = FastGettext::TranslationRepository.build('xx', options)
      repo.class.should == FastGettext::TranslationRepository::Dummy
      repo.name.should == 'xx'
      repo.options.should == options
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fast_gettext-0.8.1 spec/fast_gettext/translation_repository_spec.rb
fast_gettext-0.8.0 spec/fast_gettext/translation_repository_spec.rb
fast_gettext-0.7.1 spec/fast_gettext/translation_repository_spec.rb
fast_gettext-0.7.0 spec/fast_gettext/translation_repository_spec.rb
fast_gettext-0.6.12 spec/fast_gettext/translation_repository_spec.rb
fast_gettext-0.6.11 spec/fast_gettext/translation_repository_spec.rb
fast_gettext-0.6.10 spec/fast_gettext/translation_repository_spec.rb
fast_gettext-0.6.9 spec/fast_gettext/translation_repository_spec.rb
fast_gettext-0.6.8 spec/fast_gettext/translation_repository_spec.rb
fast_gettext-0.6.7 spec/fast_gettext/translation_repository_spec.rb