Sha256: 4726305df18a4a445bc238096874bb09ed6ce924f75f25cdeabc7ba673e50ca4
Contents?: true
Size: 1.41 KB
Versions: 13
Compression:
Stored size: 1.41 KB
Contents
#!/usr/bin/env ruby require 'helpers' require 'tempfile' require 'logger' require 'fileutils' require 'rspec' require 'configurability' require 'configurability/deferred_config' ##################################################################### ### C O N T E X T S ##################################################################### describe Configurability::DeferredConfig do after( :each ) do Configurability.configurable_objects.clear Configurability.reset end it "calls Configurability.install_config with itself when a 'configure' method is defined" do config = { :testing => :testing_config } Configurability.configure_objects( config ) a_class = Class.new do extend Configurability::DeferredConfig class << self; attr_accessor :config_object; end def self::config_key; "testing"; end def self::configure( config ) self.config_object = config end end expect( a_class.config_object ).to be( :testing_config ) end it "includes defaults when configuring" do config = { :testing => :testing_config } Configurability.configure_objects( config ) a_class = Class.new do extend Configurability::DeferredConfig class << self; attr_accessor :config_object; end def self::config_key; "testing"; end def self::configure( config ) self.config_object = config end end expect( a_class.config_object ).to be( :testing_config ) end end # vim: set nosta noet ts=4 sw=4:
Version data entries
13 entries across 13 versions & 1 rubygems