Skip to content

Commit

Permalink
load paths 'n stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Mar 2, 2010
1 parent 01b9bb0 commit a8f577a
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 47 deletions.
24 changes: 11 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
require 'rubygems'
gem 'jeweler', '>= 1.4.0'
$LOAD_PATH << File.expand_path("../lib", __FILE__)
require 'rake'
$:.unshift File.expand_path(File.join(File.dirname(__FILE__),'lib'))
require 'rspec/expectations/version'

begin
Expand All @@ -24,7 +22,7 @@ begin
Thank you for installing #{gem.summary}
The 'a' in #{gem.version} means this is alpha software.
The 'b' in #{gem.version} means this is beta software.
If you are looking for a supported production release,
please "gem install rspec" (without --pre).
Expand All @@ -37,20 +35,20 @@ end

begin
require 'rspec/core/rake_task'
Rspec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = "spec/**/*_spec.rb"
end
Rspec::Core::RakeTask.new(:spec)
rescue LoadError
puts "Rspec core or one of its dependencies is not installed. Install it with: gem install rspec-meta"
puts "Rspec core or one of its dependencies is not installed. Install it with: gem install rspec-core"
end

require 'cucumber/rake/task'

Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w{--format progress}
begin
require 'cucumber/rake/task'
Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w{--format progress}
end
rescue LoadError
puts "Cucumber or one of its dependencies is not installed. Install it with: gem install cucumber"
end


task :default => [:check_dependencies, :spec, :cucumber]

require 'rake/rdoctask'
Expand Down
57 changes: 28 additions & 29 deletions lib/rspec/matchers.rb
Original file line number Diff line number Diff line change
@@ -1,33 +1,4 @@
require 'rspec/matchers/extensions/instance_exec'
require 'rspec/matchers/pretty'
require 'rspec/matchers/matcher'
require 'rspec/matchers/operator_matcher'
require 'rspec/matchers/be'
require 'rspec/matchers/be_close'
require 'rspec/matchers/be_instance_of'
require 'rspec/matchers/be_kind_of'
require 'rspec/matchers/change'
require 'rspec/matchers/eq'
require 'rspec/matchers/eql'
require 'rspec/matchers/equal'
require 'rspec/matchers/errors'
require 'rspec/matchers/exist'
require 'rspec/matchers/generated_descriptions'
require 'rspec/matchers/has'
require 'rspec/matchers/have'
require 'rspec/matchers/include'
require 'rspec/matchers/match'
require 'rspec/matchers/match_array'
require 'rspec/matchers/method_missing'
require 'rspec/matchers/raise_error'
require 'rspec/matchers/respond_to'
require 'rspec/matchers/satisfy'
require 'rspec/matchers/throw_symbol'
require 'rspec/matchers/compatibility'
require 'rspec/matchers/dsl'

module Rspec

# RSpec ships with a number of useful Expression Matchers. An Expression Matcher
# is any object that responds to the following methods:
#
Expand Down Expand Up @@ -197,3 +168,31 @@ module Matchers
end
end

require 'rspec/matchers/extensions/instance_exec'
require 'rspec/matchers/pretty'
require 'rspec/matchers/matcher'
require 'rspec/matchers/operator_matcher'
require 'rspec/matchers/be'
require 'rspec/matchers/be_close'
require 'rspec/matchers/be_instance_of'
require 'rspec/matchers/be_kind_of'
require 'rspec/matchers/change'
require 'rspec/matchers/eq'
require 'rspec/matchers/eql'
require 'rspec/matchers/equal'
require 'rspec/matchers/errors'
require 'rspec/matchers/exist'
require 'rspec/matchers/generated_descriptions'
require 'rspec/matchers/has'
require 'rspec/matchers/have'
require 'rspec/matchers/include'
require 'rspec/matchers/match'
require 'rspec/matchers/match_array'
require 'rspec/matchers/method_missing'
require 'rspec/matchers/raise_error'
require 'rspec/matchers/respond_to'
require 'rspec/matchers/satisfy'
require 'rspec/matchers/throw_symbol'
require 'rspec/matchers/compatibility'
require 'rspec/matchers/dsl'

19 changes: 14 additions & 5 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
$LOAD_PATH << File.expand_path('../../../rspec-core/lib', __FILE__)
$LOAD_PATH << File.expand_path('../../../rspec-mocks/lib', __FILE__)
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
require 'rspec/mocks'
def add_to_load_path(path, prepend=false)
path = File.expand_path("../#{path}", __FILE__)
if prepend
$LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
else
$LOAD_PATH << path unless $LOAD_PATH.include?(path)
end
end

add_to_load_path("../lib", :prepend)
add_to_load_path("../../rspec-core/lib")
add_to_load_path("../../rspec-mocks/lib")

require 'rspec/core'
require 'rspec/expectations'
require 'rspec/mocks'

Dir['./spec/support/**/*'].each do |f|
require f
Expand Down

0 comments on commit a8f577a

Please sign in to comment.