Skip to content

Commit

Permalink
Setting Up Test Environment
Browse files Browse the repository at this point in the history
  • Loading branch information
robertomiranda committed Apr 6, 2013
1 parent 9922e06 commit 8ed1f27
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
require "bundler/gem_tasks"
require 'rake/testtask'
Bundler::GemHelper.install_tasks

task :console do
puts "Loading development console..."
system("irb -r active_model_otp")
end

task :help do
puts "Available rake tasks: "
puts "rake console - Run a IRB console with all enviroment loaded"
puts "rake test - Run tests"
end

task :test do
Dir.chdir('test')
end

Rake::TestTask.new(:test) do |t|
t.libs << '../lib'
t.libs << '../test'
t.test_files = FileList['*_test.rb']
t.verbose = false
end

task :default => :test
1 change: 1 addition & 0 deletions active_model_otp.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ Gem::Specification.new do |spec|

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
spec.add_development_dependency "minitest"
end
6 changes: 6 additions & 0 deletions test/gem_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require "test_helper"
class AppTest < MiniTest::Unit::TestCase
def test_the_truth
assert true
end
end
10 changes: 10 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
testdir = File.dirname(__FILE__)
$LOAD_PATH.unshift testdir unless $LOAD_PATH.include?(testdir)

libdir = File.dirname(File.dirname(__FILE__)) + '/lib'
$LOAD_PATH.unshift libdir unless $LOAD_PATH.include?(libdir)

require "rubygems"
require "active_model_otp"
require "minitest/unit"
require "minitest/autorun"

0 comments on commit 8ed1f27

Please sign in to comment.