class FuzzBert::RakeTask

Attributes

fuzzbert_opts[RW]

Command line options to pass to fuzzbert.

default:

nil
fuzzbert_path[RW]

Path to FuzzBert

default:

'fuzzbert'
name[RW]

Name of task.

default:

:fuzz
pattern[RW]

Glob pattern to match files.

default:

'fuzz/**/fuzz_*.rb'
ruby_opts[RW]

Command line options to pass to ruby.

default:

nil

Public Class Methods

new(*args) { |self| ... } click to toggle source
# File lib/fuzzbert/rake_task.rb, line 38
def initialize(*args)
  #configure the rake task
  setup_ivars(args)
  yield self if block_given?

  desc "Run FuzzBert random test suite" unless ::Rake.application.last_comment

  task name do
    run_task
  end
end

Public Instance Methods

run_task() click to toggle source
# File lib/fuzzbert/rake_task.rb, line 57
def run_task
  begin
    system(command)
  rescue
    #silent, user could have interrupted a permanent session
  end
end
setup_ivars(*args) click to toggle source
# File lib/fuzzbert/rake_task.rb, line 50
def setup_ivars(*args)
  @name = args.shift || :fuzz
  @ruby_opts, @fuzzbert_opts = nil, nil
  @fuzzbert_path = 'fuzzbert'
  @pattern = 'fuzz/**/fuzz_*.rb'
end

Private Instance Methods

blank() click to toggle source
# File lib/fuzzbert/rake_task.rb, line 72
def blank
  lambda {|s| s.nil? || s == ""}
end
command() click to toggle source
# File lib/fuzzbert/rake_task.rb, line 67
def command
  cmd = [RUBY, ruby_opts, '-S', fuzzbert_path, fuzzbert_opts, pattern]
  cmd.flatten.reject(&blank).join(" ")
end