Rakefile in how_is-18.0.3 vs Rakefile in how_is-18.0.4

- old
+ new

@@ -1,18 +1,23 @@ +# frozen_string_literal: true + require 'bundler/gem_tasks' require 'rspec/core/rake_task' require 'timecop' -#require 'vcr' require './spec/vcr_helper.rb' require 'how_is' -RSpec::Core::RakeTask.new(:spec) +RSpec::Core::RakeTask.new(:spec) do |t| + # Warning.warn() was added in Ruby 2.4.0, so don't use -w on older versions. + t.ruby_opts = '-w -r./spec/capture_warnings.rb' if RUBY_VERSION >= '2.4.0' +end task :default => :spec +# Helper functions used later in the Rakefile. class HelperFunctions - def self.freeze_time(&block) + def self.freeze_time(&_block) date = DateTime.parse('2016-11-01').new_offset(0) Timecop.freeze(date) do yield end end @@ -24,10 +29,10 @@ options = { repository: repository, format: format, } - cassette = repository.gsub('/', '-') + cassette = repository.tr('/', '-') VCR.use_cassette(cassette) do report = HowIs.generate_report(**options) end filename = "#{cassette}-report.#{format}"