diff --git a/Gemfile b/Gemfile index 4e4f171..0315961 100644 --- a/Gemfile +++ b/Gemfile @@ -6,3 +6,7 @@ gem 'sequel' gem 'sinatra-jsonp' gem 'unicorn' gem 'yajl-ruby', require: 'yajl' + +group :test do + gem 'rack-test' +end diff --git a/Gemfile.lock b/Gemfile.lock index 009dab9..f342751 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,6 +10,8 @@ GEM rack (1.4.1) rack-protection (1.2.0) rack + rack-test (0.6.2) + rack (>= 1.0) raindrops (0.10.0) sequel (3.41.0) sinatra (1.3.3) @@ -32,6 +34,7 @@ PLATFORMS DEPENDENCIES fixer pg + rack-test sequel sinatra-jsonp unicorn diff --git a/Rakefile b/Rakefile index a9e0a70..8f123d7 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ require_relative 'lib/db' require 'fixer' +require 'rake/testtask' task :reset do data = Fixer::Feed.new(:historical).to_a @@ -13,3 +14,11 @@ task :update do Currency.find_or_create hsh end end + +Rake::TestTask.new do |t| + t.libs.push 'lib' + t.test_files = FileList['spec/*_spec.rb'] + t.verbose = true +end + +task :default => [:test] diff --git a/spec/helper.rb b/spec/helper.rb new file mode 100644 index 0000000..3274fe8 --- /dev/null +++ b/spec/helper.rb @@ -0,0 +1,2 @@ +require 'minitest/autorun' +require 'minitest/pride'