Permalink
Browse files

autoload matcher classes to reduce startup time

  • Loading branch information...
dchelimsky committed Jan 12, 2012
1 parent b7f6dde commit a0f5026493e69495b53ad0668db68a6bff02c893
Showing with 31 additions and 23 deletions.
  1. +31 −23 lib/rspec/matchers/built_in.rb
@@ -1,25 +1,33 @@
-require 'rspec/matchers/built_in/base_matcher'
-require 'rspec/matchers/built_in/be'
-require 'rspec/matchers/built_in/be_instance_of'
-require 'rspec/matchers/built_in/base_matcher.rb'
-require 'rspec/matchers/built_in/be.rb'
-require 'rspec/matchers/built_in/be_instance_of.rb'
-require 'rspec/matchers/built_in/be_kind_of.rb'
-require 'rspec/matchers/built_in/be_within.rb'
-require 'rspec/matchers/built_in/change.rb'
-require 'rspec/matchers/built_in/cover.rb' if defined?("[].cover?")
-require 'rspec/matchers/built_in/eq.rb'
-require 'rspec/matchers/built_in/eql.rb'
-require 'rspec/matchers/built_in/equal.rb'
-require 'rspec/matchers/built_in/exist.rb'
-require 'rspec/matchers/built_in/has.rb'
-require 'rspec/matchers/built_in/have.rb'
-require 'rspec/matchers/built_in/include.rb'
-require 'rspec/matchers/built_in/match.rb'
-require 'rspec/matchers/built_in/match_array.rb'
-require 'rspec/matchers/built_in/raise_error.rb'
-require 'rspec/matchers/built_in/respond_to.rb'
-require 'rspec/matchers/built_in/satisfy.rb'
-require 'rspec/matchers/built_in/throw_symbol.rb'
+module RSpec
+ module Matchers
+ module BuiltIn
+ require 'rspec/matchers/built_in/base_matcher'
+ autoload :BeAnInstanceOf, 'rspec/matchers/built_in/be_instance_of'
+ autoload :Be, 'rspec/matchers/built_in/be'
+ autoload :BeTrue, 'rspec/matchers/built_in/be'
+ autoload :BeFalse, 'rspec/matchers/built_in/be'
+ autoload :BeNil, 'rspec/matchers/built_in/be'
+ autoload :BeComparedTo, 'rspec/matchers/built_in/be'
+ autoload :BePredicate, 'rspec/matchers/built_in/be'
+ autoload :BeAKindOf, 'rspec/matchers/built_in/be_kind_of'
+ autoload :BeWithin, 'rspec/matchers/built_in/be_within'
+ autoload :Change, 'rspec/matchers/built_in/change'
+ autoload :Cover, 'rspec/matchers/built_in/cover' if defined?("[].cover?")
+ autoload :Eq, 'rspec/matchers/built_in/eq'
+ autoload :Eql, 'rspec/matchers/built_in/eql'
+ autoload :Equal, 'rspec/matchers/built_in/equal'
+ autoload :Exist, 'rspec/matchers/built_in/exist'
+ autoload :Has, 'rspec/matchers/built_in/has'
+ autoload :Have, 'rspec/matchers/built_in/have'
+ autoload :Include, 'rspec/matchers/built_in/include'
+ autoload :Match, 'rspec/matchers/built_in/match'
+ autoload :MatchArray, 'rspec/matchers/built_in/match_array'
+ autoload :RaiseError, 'rspec/matchers/built_in/raise_error'
+ autoload :RespondTo, 'rspec/matchers/built_in/respond_to'
+ autoload :Satisfy, 'rspec/matchers/built_in/satisfy'
+ autoload :ThrowSymbol, 'rspec/matchers/built_in/throw_symbol'
+ end
+ end
+end

0 comments on commit a0f5026

Please sign in to comment.