Class: InfinityTest::ApplicationLibrary::RubyGems

Inherits:
Object
  • Object
show all
Includes:
HeuristicsHelper
Defined in:
lib/infinity_test/application_library/rubygems.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HeuristicsHelper

#heuristics

Constructor Details

#initializeRubyGems

Returns a new instance of RubyGems.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/infinity_test/application_library/rubygems.rb', line 7

def initialize
  @application  = InfinityTest.application
  @lib_pattern  = "^lib/*/(.*)\.rb"
  if @application.using_test_unit?
    @test_pattern = "^test/*/(.*)_test.rb"
    @test_helper_pattern = "^test/*/test_helper.rb"
  else
    @test_pattern = "^spec/*/(.*)_spec.rb"
    @test_helper_pattern = "^spec/*/spec_helper.rb"
  end
end

Instance Attribute Details

#applicationObject

Returns the value of attribute application.



5
6
7
# File 'lib/infinity_test/application_library/rubygems.rb', line 5

def application
  @application
end

#lib_patternObject

Returns the value of attribute lib_pattern.



5
6
7
# File 'lib/infinity_test/application_library/rubygems.rb', line 5

def lib_pattern
  @lib_pattern
end

#test_helper_patternObject

Returns the value of attribute test_helper_pattern.



5
6
7
# File 'lib/infinity_test/application_library/rubygems.rb', line 5

def test_helper_pattern
  @test_helper_pattern
end

#test_patternObject

Returns the value of attribute test_pattern.



5
6
7
# File 'lib/infinity_test/application_library/rubygems.rb', line 5

def test_pattern
  @test_pattern
end

Instance Method Details

#add_heuristics!Object

Add Heuristics to send to Watchr Methods This methods aren’t tested!



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/infinity_test/application_library/rubygems.rb', line 22

def add_heuristics!
  rubygems = self
  heuristics do

    add(rubygems.lib_pattern) do |file|
      run :test_for => file
    end

    add(rubygems.test_pattern) do |file|
      run file
    end

    add(rubygems.test_helper_pattern) do |file|
      run :all => :tests
    end

  end
end