Module: Bones::Plugins::Zentest

Extended by:
Zentest
Includes:
Helpers
Included in:
Zentest
Defined in:
lib/bones/plugins/zentest.rb

Instance Method Summary collapse

Instance Method Details

#define_tasksObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/bones/plugins/zentest.rb', line 13

def define_tasks
  return unless have? :zentest

  if have? :test
    require 'autotest'
    namespace :test do
      task :autotest do
        load '.autotest' if test(?f, '.autotest')
        Autotest.run
      end
    end

    desc 'Run the autotest loop'
    task :autotest => 'test:autotest'
  end

  if have? :spec
    require 'autotest/rspec'
    namespace :spec do
      task :autotest do
        load '.autotest' if test(?f, '.autotest')
        Autotest::Rspec.run
      end
    end

    desc 'Run the autotest loop'
    task :autotest => 'spec:autotest'
  end
end

#post_loadObject



6
7
8
9
10
11
# File 'lib/bones/plugins/zentest.rb', line 6

def post_load
  require 'zentest'
  have?(:zentest) { true }
rescue LoadError
  have?(:zentest) { false }
end