Class: Synthesis::Task
- Includes:
- Logging
- Defined in:
- lib/synthesis/task.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#formatter ⇒ Object
Returns the value of attribute formatter.
-
#formatter_out ⇒ Object
Returns the value of attribute formatter_out.
-
#ignored ⇒ Object
Returns the value of attribute ignored.
-
#libs ⇒ Object
Returns the value of attribute libs.
-
#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.
12 13 14 15 16 17 18 19 20 |
# File 'lib/synthesis/task.rb', line 12 def initialize(name='synthesis:test') @name, @ignored, @libs = name, [], [] yield self if block_given? @pattern ||= 'test/**/*_test.rb' @ruby_opts ||= [] @adapter ||= :mocha @formatter ||= :text define end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
10 11 12 |
# File 'lib/synthesis/task.rb', line 10 def adapter @adapter end |
#formatter ⇒ Object
Returns the value of attribute formatter.
10 11 12 |
# File 'lib/synthesis/task.rb', line 10 def formatter @formatter end |
#formatter_out ⇒ Object
Returns the value of attribute formatter_out.
10 11 12 |
# File 'lib/synthesis/task.rb', line 10 def formatter_out @formatter_out end |
#ignored ⇒ Object
Returns the value of attribute ignored.
10 11 12 |
# File 'lib/synthesis/task.rb', line 10 def ignored @ignored end |
#libs ⇒ Object
Returns the value of attribute libs.
10 11 12 |
# File 'lib/synthesis/task.rb', line 10 def libs @libs end |
#out ⇒ Object
Returns the value of attribute out.
10 11 12 |
# File 'lib/synthesis/task.rb', line 10 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
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/synthesis/task.rb', line 33 def define desc "Run Synthesis tests" task @name do RakeFileUtils.verbose(@verbose) do load_paths 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, @formatter, @formatter_out) end end self end |
#ignore(*classes) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/synthesis/task.rb', line 22 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 |