Class: TargetPractice
- Inherits:
-
Object
- Object
- TargetPractice
- Defined in:
- lib/target_practice.rb,
lib/target_practice/version.rb
Constant Summary collapse
- VERSION =
'0.0.5'
Instance Attribute Summary collapse
-
#pattern ⇒ Object
Returns the value of attribute pattern.
-
#test_class ⇒ Object
Returns the value of attribute test_class.
Instance Method Summary collapse
-
#initialize(sym) {|_self| ... } ⇒ TargetPractice
constructor
A new instance of TargetPractice.
- #run_tests ⇒ Object
Constructor Details
#initialize(sym) {|_self| ... } ⇒ TargetPractice
Returns a new instance of TargetPractice.
16 17 18 19 20 21 22 23 |
# File 'lib/target_practice.rb', line 16 def initialize(sym) @pattern = "" @test_class = nil yield self run_tests end |
Instance Attribute Details
#pattern ⇒ Object
Returns the value of attribute pattern.
14 15 16 |
# File 'lib/target_practice.rb', line 14 def pattern @pattern end |
#test_class ⇒ Object
Returns the value of attribute test_class.
14 15 16 |
# File 'lib/target_practice.rb', line 14 def test_class @test_class end |
Instance Method Details
#run_tests ⇒ Object
25 26 27 28 29 30 |
# File 'lib/target_practice.rb', line 25 def run_tests files = FileList[@pattern].to_a test = @test_class.new(:tests_against_files) test.files = files.map!{ |file| JSON.parse(File.open(file, 'r').read) } MiniTest::Unit.new.run end |