Updated rspec to v3 and replaced rcov with simplecov.
Also used transpec to convert from "should" syntax to preferred "expect" syntax.
This commit is contained in:
1 parent
bfa5225766
commit
78ff182905
14 files changed
+410
-425
No files matched your search
+1
-1
@@ -37,7 +37,7 @@ namespace :gem do
|
||||
|
||||
# Dependencies used in the examples
|
||||
s.add_development_dependency('rake', '>= 0.9.0')
|
||||
s.add_development_dependency('rspec', '>= 2.11.0')
|
||||
s.add_development_dependency('rspec', '~> 3.0')
|
||||
|
||||
s.require_path = 'lib'
|
||||
|
||||
|
||||
+2
-37
@@ -7,7 +7,6 @@ namespace :spec do
|
||||
RSpec::Core::RakeTask.new(:all) do |t|
|
||||
t.pattern = FileList['spec/**/*_spec.rb']
|
||||
t.rspec_opts = ['--color', '--format', 'documentation']
|
||||
t.rcov = false
|
||||
end
|
||||
|
||||
desc 'Generate HTML Specdocs for all specs.'
|
||||
@@ -17,41 +16,7 @@ namespace :spec do
|
||||
t.rspec_opts = %W( --format html --out #{File.join(specdoc_path, 'index.html')} )
|
||||
t.fail_on_error = false
|
||||
end
|
||||
|
||||
RSpec::Core::RakeTask.new(:rcov) do |t|
|
||||
if RCOV_ENABLED
|
||||
if `which rcov`.strip == ""
|
||||
STDERR.puts(
|
||||
"Please install rcov and ensure that its binary is in the PATH:"
|
||||
)
|
||||
STDERR.puts("sudo gem install rcov")
|
||||
exit(1)
|
||||
end
|
||||
t.rcov = true
|
||||
else
|
||||
t.rcov = false
|
||||
end
|
||||
t.rcov_opts = %w(
|
||||
--exclude gems/
|
||||
--exclude spec/
|
||||
--exclude lib/google/api_client/environment.rb
|
||||
--exclude lib/compat
|
||||
)
|
||||
end
|
||||
|
||||
namespace :rcov do
|
||||
desc 'Browse the code coverage report.'
|
||||
task :browse => 'spec:rcov' do
|
||||
require 'launchy'
|
||||
Launchy::Browser.run('coverage/index.html')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if RCOV_ENABLED
|
||||
desc 'Alias to spec:rcov'
|
||||
task 'spec' => 'spec:rcov'
|
||||
else
|
||||
desc 'Alias to spec:all'
|
||||
task 'spec' => 'spec:all'
|
||||
end
|
||||
desc 'Alias to spec:all'
|
||||
task 'spec' => 'spec:all'
|
||||
Reference in new issue
Block a user