forked from websocket-rails/websocket-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
72 lines (61 loc) · 1.51 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# encoding: UTF-8
require 'rubygems'
require 'rake'
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
begin
require 'rdoc/task'
rescue LoadError
require 'rdoc/rdoc'
require 'rake/rdoctask'
RDoc::Task = Rake::RDocTask
end
Bundler::GemHelper.install_tasks
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'websocket-rails'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.md')
rdoc.rdoc_files.include('lib/**/*.rb')
end
require 'rspec/core/rake_task'
desc 'Default: run RSpec and Jasmine specs.'
task :default => :spec_and_jasmine
desc "Run specs"
RSpec::Core::RakeTask.new do |t|
t.pattern = "./spec/**/*_spec.rb"
end
desc "Run rspec and jasmine:ci at the same time"
task :spec_and_jasmine do
Rake::Task["spec"].execute
Rake::Task["jasmine:ci:headless"].execute
end
desc "Generate code coverage"
task :coverage do
ENV['COVERAGE'] = 'true'
Rake::Task["spec"].execute
`open coverage/index.html`
end
begin
require 'jasmine'
load 'jasmine/tasks/jasmine.rake'
rescue LoadError
task :jasmine do
abort "Jasmine is not available. In order to run jasmine, you must: (sudo) gem install jasmine"
end
end
require 'headless'
require 'selenium-webdriver'
namespace :jasmine do
namespace :ci do
desc "Run Jasmine CI build headlessly"
task :headless do
ENV['DISPLAY'] = ':99.0'
puts "Running Jasmine Headlessly"
Rake::Task['jasmine:ci'].invoke
end
end
end