Sha256: db69ef78a583abee96a7759caaf63c884203b06eb810560f44d7f2b2a7167f71

Contents?: true

Size: 1.5 KB

Versions: 5

Compression:

Stored size: 1.5 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

module Spec
  module DSL
    describe Configuration do
      before(:each) do
        @config = Configuration.new
        @behaviour = mock("behaviour")
      end

      it "should default mock framework to rspec" do
        @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/rspec$/
      end

      it "should let you set rspec mocking explicitly" do
        @config.mock_with(:rspec)
        @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/rspec$/
      end

      it "should let you set mocha" do
        @config.mock_with(:mocha)
        @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/mocha$/
      end

      it "should let you set flexmock" do
        @config.mock_with(:flexmock)
        @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/flexmock$/
      end
      
      it "should let you set an arbitrary adapter module" do
        adapter = Module.new
        @config.mock_with(adapter)
        @config.mock_framework.should == adapter
      end
      
      it "should let you define modules to be included" do
        mod = Module.new
        @config.include mod
        @config.included_modules.should include(mod)
      end
      
      [:prepend_before, :append_before, :prepend_after, :append_after].each do |m|
        it "should delegate ##{m} to Behaviour class" do
          Behaviour.should_receive(m).with(:whatever)
          @config.__send__(m, :whatever)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rspec-1.0.3 spec/spec/dsl/configuration_spec.rb
rspec-1.0.0 spec/spec/dsl/configuration_spec.rb
rspec-1.0.1 spec/spec/dsl/configuration_spec.rb
rspec-1.0.2 spec/spec/dsl/configuration_spec.rb
rspec-1.0.4 spec/spec/dsl/configuration_spec.rb