Sha256: c242c54f3565bf690b5f6b51593811e7aa8be08dfb80ce575a2a09f7a521a146

Contents?: true

Size: 1.08 KB

Versions: 17

Compression:

Stored size: 1.08 KB

Contents

require 'autotest'

Autotest.add_hook :initialize do |at|
  at.clear_mappings
  # watch out: Ruby bug (1.8.6):
  # %r(/) != /\//
  at.add_mapping(%r%^examples/.*_example.rb$%) { |filename, _| 
    filename 
  }
  
  at.add_mapping(%r%^lib/(.*)\.rb$%) { |filename, m| 
    ["examples/lib/#{m[1]}_example.rb"]
  }
  
  at.add_mapping(%r%^examples/(example_helper|shared/.*)\.rb$%) { 
    at.files_matching %r%^examples/.*_example\.rb$%
  }
end

class MicronautCommandError < StandardError; end

class Autotest::Micronaut < Autotest

  def initialize
    super
    self.failed_results_re = /^\d+\)\n(?:\e\[\d*m)?(?:.*?Error in )?'([^\n]*)'(?: FAILED)?(?:\e\[\d*m)?\n(.*?)\n\n/m
    self.completed_re = /\n(?:\e\[\d*m)?\d* examples?/m
  end
  
  def consolidate_failures(failed)
    filters = new_hash_of_arrays
    failed.each do |spec, trace|
      if trace =~ /\n(\.\/)?(.*example\.rb):[\d]+:\Z?/
        filters[$2] << spec
      end
    end
    return filters
  end

  def make_test_cmd(files_to_test)
    return '' if files_to_test.size == 0
    "bin/micronaut #{files_to_test.keys.join(' ')}"
  end
  
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
spicycode-micronaut-0.1.4.3 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.4.4 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.5.2 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.5 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.6.1 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.6.8 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.6.9.1 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.6.9 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.6 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.7.1 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.7.2 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.7.3 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.7.4 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.7 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.8.0 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.8.1 lib/autotest/micronaut.rb
spicycode-micronaut-0.1.8.2 lib/autotest/micronaut.rb