Permalink
Browse files

add a spec task with rcov included, move the digest/md5 requirement t…

…o init.rb and outta the models i pinched
  • Loading branch information...
1 parent 73a2f2c commit 96c47076418dc427e1a3e0500c4ec1402ebc8cc8 @atmos committed Dec 19, 2008
Showing with 16 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +13 −1 Rakefile
  3. +0 −1 app/models/braintree/gateway_request.rb
  4. +0 −1 app/models/braintree/gateway_response.rb
  5. +2 −1 config/init.rb
View
@@ -21,3 +21,4 @@ merb_profile_results
bin
config/database.yml
config/braintree.yml
+coverage
View
@@ -27,9 +27,21 @@ end
require 'spec/rake/spectask'
require 'merb-core/test/tasks/spectasks'
desc 'Default: run spec examples'
-task :default => 'spec'
+task :default => 'spec:ci'
##############################################################################
# ADD YOUR CUSTOM TASKS IN /lib/tasks
# NAME YOUR RAKE FILES file_name.rake
##############################################################################
+#
+namespace :spec do
+ Spec::Rake::SpecTask.new(:ci) do |t|
+ t.spec_opts << %w(-fs --color) << %w(-o spec/spec.opts)
+ t.spec_opts << '--loadby' << 'random'
+ t.spec_files = %w(requests models helpers views).collect { |dir| Dir["spec/#{dir}/**/*_spec.rb"] }.flatten
+ t.rcov = ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true
+ t.rcov_opts << '--exclude' << 'spec,config,gems,.salesforce,exceptions.rb,schema.rb'
+ t.rcov_opts << '--text-summary'
+ t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
+ end
+end
@@ -1,4 +1,3 @@
-require 'digest/md5'
module Braintree
class GatewayRequest
attr_accessor :orderid, :amount, :key, :key_id, :time, :response_url,
@@ -1,4 +1,3 @@
-require 'digest/md5'
module Braintree
class GatewayResponse
View
@@ -1,6 +1,7 @@
# Go to http://wiki.merbivore.com/pages/init-rb
require 'config/dependencies.rb'
-
+require 'digest/md5'
+
use_orm :datamapper
use_test :rspec
use_template_engine :haml

0 comments on commit 96c4707

Please sign in to comment.