Class: Synthesis::Task
- Includes:
- Logging
- Defined in:
- lib/synthesis/task.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#ignored ⇒ Object
Returns the value of attribute ignored.
-
#out ⇒ Object
Returns the value of attribute out.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
-
#ruby_opts ⇒ Object
Returns the value of attribute ruby_opts.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
- #define ⇒ Object
- #ignore(*classes) ⇒ Object
-
#initialize(name = 'synthesis:test') {|_self| ... } ⇒ Task
constructor
A new instance of Task.
Methods included from Logging
Constructor Details
#initialize(name = 'synthesis:test') {|_self| ... } ⇒ Task
Returns a new instance of Task.
11 12 13 14 15 16 17 18 |
# File 'lib/synthesis/task.rb', line 11 def initialize(name='synthesis:test') @name, @ignored = name, [] yield self if block_given? @pattern ||= 'test/**/*.rb' @ruby_opts ||= [] @adapter ||= :mocha define end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
9 10 11 |
# File 'lib/synthesis/task.rb', line 9 def adapter @adapter end |
#ignored ⇒ Object
Returns the value of attribute ignored.
9 10 11 |
# File 'lib/synthesis/task.rb', line 9 def ignored @ignored end |
#out ⇒ Object
Returns the value of attribute out.
9 10 11 |
# File 'lib/synthesis/task.rb', line 9 def out @out end |
#pattern ⇒ Object
Returns the value of attribute pattern.
9 10 11 |
# File 'lib/synthesis/task.rb', line 9 def pattern @pattern end |
#ruby_opts ⇒ Object
Returns the value of attribute ruby_opts.
9 10 11 |
# File 'lib/synthesis/task.rb', line 9 def ruby_opts @ruby_opts end |
#verbose ⇒ Object
Returns the value of attribute verbose.
9 10 11 |
# File 'lib/synthesis/task.rb', line 9 def verbose @verbose end |
Instance Method Details
#define ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/synthesis/task.rb', line 31 def define desc "Run Synthesis tests" task @name do RakeFileUtils.verbose(@verbose) do @ruby_opts.unshift("-w") if @warning require File.dirname(__FILE__) + "/../synthesis" require File.dirname(__FILE__) + "/../synthesis/runner" Synthesis::Logging.const_set(:OUT, @out) if @out Synthesis::ExpectationRecord.ignore(*@ignored) Synthesis::Runner.run(@adapter, @pattern) end end self end |
#ignore(*classes) ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/synthesis/task.rb', line 20 def ignore(*classes) STDERR.puts STDERR.puts "DEPRECATION WARNING!!!" STDERR.puts caller[0] STDERR.puts "Synthesis::Task#ignore(*classes) has been deprecated." STDERR.puts "Use Synthesis::Task#ignored = [#{classes * ','}] instead." STDERR.puts @ignored << classes @ignored.flatten! end |