Skip to content

Commit

Permalink
changed LOLCOMMITS_ROOT to work for tests, don't need to create a gem…
Browse files Browse the repository at this point in the history
… before testing now
  • Loading branch information
prydonius committed Apr 21, 2012
1 parent 31814de commit bffd6b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/lolcommits.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
module Lolcommits
$home = ENV['HOME']
LOLBASEDIR = File.join $home, ".lolcommits"
LOLCOMMITS_ROOT = Gem.loaded_specs['lolcommits'].full_gem_path
LOLCOMMITS_ROOT = File.join(File.dirname(__FILE__), '..')

def is_mac?
RUBY_PLATFORM.downcase.include?("darwin")
Expand Down
12 changes: 5 additions & 7 deletions test/test_lolcommits.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
require 'test/unit'

begin
require 'lolcommits'
rescue LoadError
require 'rubygems'
require 'lolcommits'
end
# Loads lolcommits directly from the lib folder so don't have to create
# a gem before testing
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'lolcommits'

include Lolcommits

Expand Down

0 comments on commit bffd6b8

Please sign in to comment.