Rakefile 808 Bytes
Newer Older
1
2
3
require 'bundler/setup'

task :travis  => ['test:travis', 'coveralls_push_workaround']
4
task :default => [:test]
5

6
require "rake/testtask"
7

8
9
10
11
12
13

Rake::TestTask.new do |t|
  t.libs << "lib"
  t.libs << "spec"
  t.pattern = "spec/**/*_spec.rb"
end
14
15
16
17
18
19

namespace :test do
  mock = 'true' || ENV['FOG_MOCK']
  task :travis do
    # jruby coveralls causes an OOM in travis
    ENV['COVERAGE'] = 'false' if RUBY_PLATFORM == 'java'
20
    sh("export FOG_MOCK=#{mock} && rake")
21
22
23
24
25
26
27
28
29
30
31
32
33
  end
end

#require "tasks/changelog_task"
#Fog::Rake::ChangelogTask.new
task :coveralls_push_workaround do
  use_coveralls = (Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.9.2'))
  if (ENV['COVERAGE'] != 'false') && use_coveralls
    require 'coveralls/rake/task'
    Coveralls::RakeTask.new
    Rake::Task["coveralls:push"].invoke
  end
end