Sha256: 07f3825953b366f0abdddff90e861f7418eaa625e731e2234ec86fc75673e75d

Contents?: true

Size: 1.39 KB

Versions: 33

Compression:

Stored size: 1.39 KB

Contents

require 'rubygems/tasks'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
Gem::Tasks.new

def windows?
  # Ruby only sets File::ALT_SEPARATOR on Windows and the Ruby standard
  # library uses that to test what platform it's on.
  !!File::ALT_SEPARATOR
end

RSpec::Core::RakeTask.new(:spec) do |t|
  t.rspec_opts = '--pattern spec/onceover/**/*_spec.rb'
end

RSpec::Core::RakeTask.new(:acceptance) do |t|
  t.rspec_opts = '--pattern spec/acceptance/**/*_spec.rb'
end

Cucumber::Rake::Task.new

task default: :full_tests


desc "Run unit tests"
task rspec_unit_tests: [:syntax, :rubocop, :spec]

desc "Run acceptance cucumber tests"
task cucumber_acceptance_tests: [:syntax, :rubocop, :fixtures, :cucumber]

desc "Run full set of tests"
task full_tests: [:rspec_unit_tests, :cucumber_acceptance_tests]

task :syntax do
  paths = ['lib', 'spec/onceover', 'features']
  require 'find'
  Find.find(*paths) do |path|
    next unless path =~ /\.rb$/
    if windows?
      sh "ruby -cw #{path} > NUL"
    else
      sh "ruby -cw #{path} > /dev/null"
    end
  end
end

task :rubocop do
  require 'rubocop'
  cli = RuboCop::CLI.new
  exit_code = cli.run(%w(--display-cop-names --format simple))
  raise "RuboCop detected offenses" if exit_code != 0
end

task :fixtures do
  system 'git submodule init && git submodule update --recursive'
  raise "Couldn't clone controlrepo to fixtures directory" unless $?.success?
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
onceover-3.19.0 Rakefile
onceover-3.18.1 Rakefile
onceover-3.18.0 Rakefile
onceover-3.17.3 Rakefile
onceover-3.17.2 Rakefile
onceover-3.17.1 Rakefile
onceover-3.17.0 Rakefile
onceover-3.16.0 Rakefile
onceover-3.15.2 Rakefile
onceover-3.15.1 Rakefile
onceover-3.15.0 Rakefile
onceover-3.14.1 Rakefile
onceover-3.14.0 Rakefile
onceover-3.13.4 Rakefile
onceover-3.13.3 Rakefile
onceover-3.13.2 Rakefile
onceover-3.13.1 Rakefile
onceover-3.13.0 Rakefile
onceover-3.12.5 Rakefile
onceover-3.12.4 Rakefile