Module: Racatt

Extended by:
Rake::DSL
Defined in:
lib/racatt.rb,
lib/racatt/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.combine_options(set_1, set_2) ⇒ Object



16
17
18
# File 'lib/racatt.rb', line 16

def self.combine_options(set_1, set_2)
  set_2 ? "#{set_1} #{set_2}" : set_1
end

.create_tasksObject



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
# File 'lib/racatt.rb', line 20

def self.create_tasks
  current_scope = Rake.application.current_scope.path

  namespace 'cucumber' do
    desc 'Run all of the Cucumber features'
    task :features, [:command_options] do |_t, args|
      set_cucumber_options(combine_options('-t ~@wip -t ~@off', args[:command_options]))
    end
    Cucumber::Rake::Task.new(:features)
  end

  namespace 'rspec' do
    desc 'Run all of the RSpec specifications'
    RSpec::Core::RakeTask.new(:specs, :command_options) do |t, args|
      t.rspec_opts = "-t ~wip -t ~off "
      t.rspec_opts << args[:command_options] if args[:command_options]
    end
  end

  desc 'Test All The Things!'
  task :test_everything, [:command_options] => [:clear_coverage] do |_t, args|
    Rake::Task["#{current_scope}:rspec:specs"].invoke(args[:command_options])
    Rake::Task["#{current_scope}:cucumber:features"].invoke(args[:command_options])
  end

end

.set_cucumber_options(options) ⇒ Object



12
13
14
# File 'lib/racatt.rb', line 12

def self.set_cucumber_options(options)
  ENV['CUCUMBER_OPTS'] = options
end