Sha256: 49d0f988f74dad0b6c8d378eb52a9fef6719372408bcadc14ae471515c5a847d

Contents?: true

Size: 727 Bytes

Versions: 1

Compression:

Stored size: 727 Bytes

Contents

require 'spec_ext'

Spec::Example::ExampleGroup.class_eval do
  def self.swap_metadata    
    old_metadata = nil
    
    before :all do
      old_metadata = Micon.metadata
      Micon.swap_metadata old_metadata.deep_clone
    end
    
    after :all do
      Micon.swap_metadata old_metadata
    end
  end
  
  def self.with_environment environment = :test
    swap_metadata
    
    before :each do    
      crystal.clear
      crystal[:config].environment = environment
    end

    after :each do
      crystal.clear      
    end    
  end
  
  inject(
    :config => :config, 
    :logger => :logger
  )
  
  def silence_logger!
    self.logger = Logger.new nil
  end  
end

# Spec::Runner.configure do |config|  
# end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crystal_ext-0.0.11 lib/crystal/spec/environment.rb