Sha256: 18b896275c8136b6be11605bc091015cb3e1b715800c7ab2cb707cf9d020dcd6

Contents?: true

Size: 1.65 KB

Versions: 3

Compression:

Stored size: 1.65 KB

Contents

require File.expand_path(File.dirname(__FILE__) + "/../../example_helper")

describe Micronaut::Configuration do

  describe "#mock_with" do
    
    it "should include the mocha adapter when called with :mocha" do
      Micronaut::Behaviour.expects(:send).with(:include, Micronaut::Mocking::WithMocha)
      Micronaut::Configuration.new.mock_with :mocha
    end
  
    it "should include the do absolutely nothing mocking adapter for all other cases" do
      Micronaut::Behaviour.expects(:send).with(:include, Micronaut::Mocking::WithAbsolutelyNothing)
      Micronaut::Configuration.new.mock_with
    end
    
  end
  
  describe "#include" do
    
    module InstanceLevelMethods
      def you_call_this_a_blt?
        "egad man, where's the mayo?!?!?"
      end
    end
    
    it "should include the given module into each behaviour group" do
      Micronaut.configuration.include(InstanceLevelMethods)
      group = Micronaut::Behaviour.describe(Object, 'does like, stuff and junk') { }
      group.should_not respond_to(:you_call_this_a_blt?)
      remove_last_describe_from_world

      group.new.you_call_this_a_blt?.should == "egad man, where's the mayo?!?!?"
    end
    
  end

  describe "#extend" do
    
    module FocusedSupport
      
      def fit(desc, options={}, &block)
        it(desc, options.merge(:focused => true), &block)
      end
      
    end
    
    it "should extend the given module into each behaviour group" do
      Micronaut.configuration.extend(FocusedSupport)
      group = Micronaut::Behaviour.describe(FocusedSupport, 'the focused support ') { }
      group.should respond_to(:fit)
      remove_last_describe_from_world
    end
    
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spicycode-micronaut-0.0.9 examples/lib/micronaut/configuration_example.rb
spicycode-micronaut-0.1.0 examples/lib/micronaut/configuration_example.rb
spicycode-micronaut-0.1.1 examples/lib/micronaut/configuration_example.rb