Permalink
Browse files

Load files better, rely on sane load paths

  • Loading branch information...
1 parent 818b5b8 commit d355f9352622dce55bdf676a4bb5a4b7d61ed774 @nate nate committed Apr 1, 2010
View
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/lib/forgery'
+require 'forgery'
View
@@ -1,26 +1,26 @@
# Require forgeries at the bottom of the file so Forgery works as a gem both
# within rails and outside of it.
-current_path = File.expand_path(File.dirname(__FILE__))
+current_path = File.expand_path(File.dirname(__FILE__)) + '/'
# Loading forgery helpers.
-require current_path + '/forgery/file_reader'
-require current_path + '/forgery/dictionaries'
-require current_path + '/forgery/formats'
+require 'forgery/file_reader'
+require 'forgery/dictionaries'
+require 'forgery/formats'
# Loading class extensions
-Dir[current_path + '/forgery/extensions/**/*.rb'].uniq.each do |file|
+Dir[current_path + 'forgery/extensions/**/*.rb'].uniq.each do |file|
require file
end
# Load the forgery base class
-require current_path + '/forgery/forgery'
+require 'forgery/forgery'
# Load the forgery api method
-require current_path + '/forgery/forgery_api'
+require 'forgery/forgery_api'
# Loading the other forgeries AFTER the initial forgery class is defined.
-Dir[current_path + '/forgery/forgery/**/*.rb'].uniq.each do |file|
+Dir[current_path + 'forgery/forgery/**/*.rb'].uniq.each do |file|
require file
end
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/spec_helper'
+require 'spec_helper'
describe Forgery::Dictionaries do
it "should check if the dictionary is loaded" do
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../spec_helper'
+require 'spec_helper'
describe Array do
before do
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../spec_helper'
+require 'spec_helper'
require 'timeout'
describe Range do
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../spec_helper'
+require 'spec_helper'
describe String do
it "should change a single # to a number 0-9" do
View
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/spec_helper'
+require 'spec_helper'
describe Forgery::FileReader do
it "should return an array when calling read_dictionary" do
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../spec_helper'
+require 'spec_helper'
describe Forgery::Address do
it "should return a random street" do
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../spec_helper'
+require 'spec_helper'
describe Forgery::Basic do
describe ".password" do
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../spec_helper'
+require 'spec_helper'
describe Forgery::Internet do
describe ".user_name" do
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../spec_helper'
+require 'spec_helper'
describe Forgery::LoremIpsum do
describe ".paragraphs" do
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../spec_helper'
+require 'spec_helper'
describe Forgery::Monetary do
end
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../spec_helper'
+require 'spec_helper'
describe Forgery::Name do
end
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../spec_helper'
+require 'spec_helper'
describe Forgery::Personal do
describe '.gender' do
View
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/spec_helper'
+require 'spec_helper'
require 'pathname'
describe Forgery do
View
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/spec_helper'
+require 'spec_helper'
describe Forgery::Formats do
it "should check if the dictionary is loaded" do
View
@@ -1,5 +1,5 @@
require 'spec'
-require File.dirname(__FILE__) + '/../init'
+require File.expand_path(File.dirname(__FILE__) + '/../init')
Spec::Runner.configure do |config|

0 comments on commit d355f93

Please sign in to comment.