Class: KalibroGem::Rake::TestTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/rake/test_task.rb

Instance Method Summary collapse

Constructor Details

#initializeTestTask



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
# File 'lib/rake/test_task.rb', line 27

def initialize

  namespace :test do
    desc 'Runs acceptance and unit tests'
    task :all => [:units, :acceptance]

    desc 'Runs the unit tests'
    task :units do
      unit_tests_command = "bundle exec rspec spec"

      puts "Running the unit tests with \"#{unit_tests_command}\"\n\n"
      system unit_tests_command
    end

    desc 'Runs the acceptance tests'
    task :acceptance, [:feature] do |t, args|
      if args.feature.nil?
        acceptance_tests_command = "bundle exec cucumber"
      else
        acceptance_tests_command = "bundle exec cucumber #{args.feature} features/step_definitions/ features/support/"
      end

      puts "Running the acceptance tests with \"#{acceptance_tests_command}\"\n\n"
      system acceptance_tests_command
    end
  end
end