infinity_test 1.0.2 → 2.0.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/ci.yml +31 -0
  3. data/.gitignore +3 -0
  4. data/.rspec +2 -2
  5. data/AI_INTEGRATION_IDEAS.md +203 -0
  6. data/Gemfile +3 -15
  7. data/History.markdown +82 -0
  8. data/INFINITY_TEST +48 -0
  9. data/LICENSE.txt +2 -2
  10. data/README.md +627 -0
  11. data/Rakefile +1 -65
  12. data/TODO.markdown +26 -9
  13. data/bin/infinity_test +1 -4
  14. data/images/fuuu/pending.png +0 -0
  15. data/images/fuuu/success.png +0 -0
  16. data/infinity_test.gemspec +41 -191
  17. data/lib/infinity_test/core/auto_discover.rb +67 -0
  18. data/lib/infinity_test/core/base.rb +369 -0
  19. data/lib/infinity_test/core/callback.rb +59 -0
  20. data/lib/infinity_test/core/changed_file.rb +13 -0
  21. data/lib/infinity_test/core/command_builder.rb +48 -0
  22. data/lib/infinity_test/core/command_runner.rb +62 -0
  23. data/lib/infinity_test/core/configuration_merge.rb +37 -0
  24. data/lib/infinity_test/core/continuous_test_server.rb +106 -0
  25. data/lib/infinity_test/core/load_configuration.rb +48 -0
  26. data/lib/infinity_test/core/notifier.rb +59 -0
  27. data/lib/infinity_test/core/options.rb +134 -0
  28. data/lib/infinity_test/core/runner.rb +18 -0
  29. data/lib/infinity_test/core/version.rb +5 -0
  30. data/lib/infinity_test/framework/base.rb +57 -0
  31. data/lib/infinity_test/framework/padrino.rb +33 -0
  32. data/lib/infinity_test/framework/rails.rb +35 -0
  33. data/lib/infinity_test/framework/rubygems.rb +29 -0
  34. data/lib/infinity_test/framework/shared_example.rb +47 -0
  35. data/lib/infinity_test/observer/base.rb +40 -0
  36. data/lib/infinity_test/observer/filewatcher.rb +72 -0
  37. data/lib/infinity_test/observer/listen.rb +74 -0
  38. data/lib/infinity_test/observer/shared_example.rb +35 -0
  39. data/lib/infinity_test/old_dsl/configuration.rb +26 -0
  40. data/lib/infinity_test/strategy/base.rb +34 -0
  41. data/lib/infinity_test/strategy/rbenv.rb +32 -0
  42. data/lib/infinity_test/strategy/ruby_default.rb +20 -0
  43. data/lib/infinity_test/strategy/rvm.rb +50 -0
  44. data/lib/infinity_test/strategy/shared_example.rb +32 -0
  45. data/lib/infinity_test/test_framework/base.rb +64 -0
  46. data/lib/infinity_test/test_framework/rspec.rb +48 -0
  47. data/lib/infinity_test/test_framework/shared_example.rb +56 -0
  48. data/lib/infinity_test/test_framework/test_unit.rb +57 -0
  49. data/lib/infinity_test.rb +53 -35
  50. data/spec/infinity_test/core/auto_discover_spec.rb +149 -0
  51. data/spec/infinity_test/core/base_spec.rb +240 -0
  52. data/spec/infinity_test/core/callback_spec.rb +89 -0
  53. data/spec/infinity_test/core/changed_file_spec.rb +26 -0
  54. data/spec/infinity_test/core/command_builder_spec.rb +38 -0
  55. data/spec/infinity_test/core/configuration_merge_spec.rb +124 -0
  56. data/spec/infinity_test/core/continuous_test_server_spec.rb +116 -0
  57. data/spec/infinity_test/core/load_configuration_spec.rb +43 -0
  58. data/spec/infinity_test/core/notifier_spec.rb +151 -0
  59. data/spec/infinity_test/core/options_spec.rb +168 -0
  60. data/spec/infinity_test/core/runner_spec.rb +17 -0
  61. data/spec/infinity_test/framework/base_spec.rb +55 -0
  62. data/spec/infinity_test/framework/padrino_spec.rb +36 -0
  63. data/spec/infinity_test/framework/rails_spec.rb +36 -0
  64. data/spec/infinity_test/framework/rubygems_spec.rb +34 -0
  65. data/spec/infinity_test/observer/base_spec.rb +78 -0
  66. data/spec/infinity_test/observer/filewatcher_spec.rb +51 -0
  67. data/spec/infinity_test/observer/listen_spec.rb +50 -0
  68. data/spec/infinity_test/{builder_spec.rb → strategy/base_spec.rb} +1 -2
  69. data/spec/infinity_test/strategy/rbenv_spec.rb +53 -0
  70. data/spec/infinity_test/strategy/ruby_default_spec.rb +32 -0
  71. data/spec/infinity_test/strategy/rvm_spec.rb +69 -0
  72. data/spec/infinity_test/test_framework/rspec_spec.rb +119 -0
  73. data/spec/infinity_test/test_framework/test_unit_spec.rb +193 -0
  74. data/spec/spec_helper.rb +34 -119
  75. metadata +276 -205
  76. data/.infinity_test +0 -36
  77. data/.rvmrc +0 -1
  78. data/Gemfile.lock +0 -62
  79. data/Readme.markdown +0 -122
  80. data/Tasks +0 -4
  81. data/VERSION.yml +0 -5
  82. data/buzz_images/buzz_lightyear.jpg +0 -0
  83. data/buzz_images/buzz_lightyear_continencia.gif +0 -0
  84. data/buzz_images/to_infinity_and_beyond.png +0 -0
  85. data/features/heuristics.feature +0 -23
  86. data/features/support/env.rb +0 -2
  87. data/images/fuuu/sucess.png +0 -0
  88. data/lib/infinity_test/application.rb +0 -355
  89. data/lib/infinity_test/application_library/rails.rb +0 -94
  90. data/lib/infinity_test/application_library/rubygems.rb +0 -43
  91. data/lib/infinity_test/binary_path.rb +0 -43
  92. data/lib/infinity_test/builder.rb +0 -67
  93. data/lib/infinity_test/command.rb +0 -58
  94. data/lib/infinity_test/configuration.rb +0 -273
  95. data/lib/infinity_test/continuous_testing.rb +0 -40
  96. data/lib/infinity_test/dependencies.rb +0 -80
  97. data/lib/infinity_test/environment.rb +0 -15
  98. data/lib/infinity_test/heuristics.rb +0 -36
  99. data/lib/infinity_test/heuristics_helper.rb +0 -9
  100. data/lib/infinity_test/options.rb +0 -89
  101. data/lib/infinity_test/runner.rb +0 -38
  102. data/lib/infinity_test/test_framework.rb +0 -109
  103. data/lib/infinity_test/test_library/bacon.rb +0 -55
  104. data/lib/infinity_test/test_library/cucumber.rb +0 -22
  105. data/lib/infinity_test/test_library/rspec.rb +0 -58
  106. data/lib/infinity_test/test_library/test_unit.rb +0 -52
  107. data/lib/infinity_test/test_unit_loader.rb +0 -5
  108. data/spec/factories/buzz/lib/buzz.rb +0 -0
  109. data/spec/factories/buzz/spec/buzz_spec.rb +0 -0
  110. data/spec/factories/company/Gemfile +0 -0
  111. data/spec/factories/company/lib/company.rb +0 -0
  112. data/spec/factories/company/test/company_test.rb +0 -0
  113. data/spec/factories/images/failure.png +0 -0
  114. data/spec/factories/images/pending.png +0 -0
  115. data/spec/factories/images/sucess.png +0 -0
  116. data/spec/factories/infinity_test +0 -5
  117. data/spec/factories/infinity_test_example +0 -7
  118. data/spec/factories/slinky/spec/slinky/slinky_spec.rb +0 -0
  119. data/spec/factories/travel/lib/travel.rb +0 -0
  120. data/spec/factories/travel/test/partner_test.rb +0 -0
  121. data/spec/factories/travel/test/travel_test.rb +0 -0
  122. data/spec/factories/wood/lib/wood.rb +0 -0
  123. data/spec/factories/wood/spec/wood_spec.rb +0 -0
  124. data/spec/infinity_test/application_library/rails_spec.rb +0 -140
  125. data/spec/infinity_test/application_library/rubygems_spec.rb +0 -52
  126. data/spec/infinity_test/application_spec.rb +0 -424
  127. data/spec/infinity_test/binary_path_spec.rb +0 -72
  128. data/spec/infinity_test/command_spec.rb +0 -53
  129. data/spec/infinity_test/configuration_spec.rb +0 -377
  130. data/spec/infinity_test/continuous_testing_spec.rb +0 -25
  131. data/spec/infinity_test/environment_spec.rb +0 -23
  132. data/spec/infinity_test/heuristics_helper_spec.rb +0 -15
  133. data/spec/infinity_test/heuristics_spec.rb +0 -127
  134. data/spec/infinity_test/options_spec.rb +0 -91
  135. data/spec/infinity_test/runner_spec.rb +0 -42
  136. data/spec/infinity_test/test_framework_spec.rb +0 -127
  137. data/spec/infinity_test/test_library/bacon_spec.rb +0 -150
  138. data/spec/infinity_test/test_library/cucumber_spec.rb +0 -8
  139. data/spec/infinity_test/test_library/rspec_spec.rb +0 -185
  140. data/spec/infinity_test/test_library/test_unit_spec.rb +0 -184
  141. data/spec/infinity_test_spec.rb +0 -40
  142. /data/images/faces/{sucess.png → success.png} +0 -0
  143. /data/images/hands/{sucess.png → success.png} +0 -0
  144. /data/images/mario_bros/{sucess.jpg → success.jpg} +0 -0
  145. /data/images/rails/{sucess.png → success.png} +0 -0
  146. /data/images/rubies/{sucess.png → success.png} +0 -0
  147. /data/images/simpson/{sucess.jpg → success.jpg} +0 -0
  148. /data/images/street_fighter/{sucess.jpg → success.jpg} +0 -0
  149. /data/images/toy_story/{sucess.png → success.png} +0 -0
@@ -1,38 +0,0 @@
1
- module InfinityTest
2
- class Runner
3
- attr_reader :options, :application
4
-
5
- def initialize(argv)
6
- @options = Options.new(argv)
7
- @application = InfinityTest.application
8
- end
9
-
10
- def run!
11
- load_configuration_file_or_read_the_options!
12
- if @options[:show_heuristics?]
13
- list_heuristics!
14
- else
15
- @application.run_global_commands!
16
- start_continuous_testing!
17
- end
18
- end
19
-
20
- def list_heuristics!
21
- @application.heuristics.patterns.keys.each do |pattern|
22
- puts %{- "#{pattern}"}
23
- end
24
- exit
25
- end
26
-
27
- def load_configuration_file_or_read_the_options!
28
- @application.load_configuration_file_or_read_the_options!(@options)
29
- end
30
-
31
- # Start Continuous Server using Watchr
32
- #
33
- def start_continuous_testing!
34
- InfinityTest::ContinuousTesting.new.start!
35
- end
36
-
37
- end
38
- end
@@ -1,109 +0,0 @@
1
- module InfinityTest
2
- class TestFramework
3
- include InfinityTest::BinaryPath
4
- include InfinityTest::Environment
5
- include InfinityTest::Builder
6
-
7
- binary :bundle
8
-
9
- attr_accessor :application, :message, :rubies, :test_pattern
10
-
11
- def initialize(options={})
12
- @application = InfinityTest.application
13
- @rubies = options[:rubies] || []
14
- end
15
-
16
- # Return all the files match by test_pattern
17
- #
18
- def all_files
19
- Dir[@test_pattern].sort
20
- end
21
-
22
- def test_files
23
- all_files.collect { |file| file }.join(' ')
24
- end
25
-
26
- def decide_files(file)
27
- return file if file
28
- test_files
29
- end
30
-
31
- # Method used in the subclasses of TestFramework
32
- #
33
- # Example:
34
- #
35
- # class Rspec < TestFramework
36
- # parse_results :example => /(\d+) example/, :failure => /(\d+) failure/, :pending => /(\d+) pending/
37
- # end
38
- #
39
- # Then will create @examples, @failure and @pending instance variables with the values in the test result
40
- #
41
- # Or with Test::Unit:
42
- #
43
- # class TestUnit < TestFramework
44
- # parse_results :tests => /(\d+) tests/, :assertions => /(\d+) assertions/, :failures => /(\d+) failures/, :errors => /(\d+) errors/
45
- # end
46
- #
47
- # Then will create @tests, @assertions, @failures and @errors instance variables with the values in the test result
48
- #
49
- def self.parse_results(patterns)
50
- raise(ArgumentError, 'patterns should not be empty') if patterns.empty?
51
- create_accessors(patterns)
52
- define_method(:parse_results) do |results|
53
- set_instances(:shell_result => test_message(results, patterns), :patterns => patterns)
54
- end
55
- end
56
-
57
- # Create accessors for keys of the Hash passed in argument
58
- #
59
- # create_accessors({ :example => '...', :failure => '...'}) # => attr_accessor :example, :failure
60
- #
61
- def self.create_accessors(hash)
62
- hash.keys.each do |attribute|
63
- attr_accessor attribute
64
- end
65
- end
66
-
67
- # Create the instance pass in the patterns options
68
- #
69
- # Useful for the parse results:
70
- # parse_results :tests => /.../, :assertions => /.../
71
- #
72
- # Then will create @tests ans @assertions (the keys of the Hash)
73
- #
74
- def create_pattern_instance_variables(patterns, shell_result)
75
- patterns.each do |key, pattern|
76
- number = shell_result[pattern, 1].to_i
77
- instance_variable_set("@#{key}", number)
78
- end
79
- @message = shell_result.gsub(/\e\[\d+?m/, '') # Clean ANSIColor strings
80
- end
81
-
82
- # Return the message of the tests
83
- #
84
- # test_message('0 examples, 0 failures', { :example => /(\d) example/}) # => '0 examples, 0 failures'
85
- # test_message('....\n4 examples, 0 failures', { :examples => /(\d) examples/}) # => '4 examples, 0 failures'
86
- #
87
- def test_message(output, patterns)
88
- lines = output.split("\n")
89
- final_result = []
90
- patterns.each do |key, pattern|
91
- final_result << lines.select { |line| line =~ pattern }
92
- end
93
- final_result.flatten.last
94
- end
95
-
96
- private
97
-
98
- def set_instances(options)
99
- shell_result, patterns = options[:shell_result], options[:patterns]
100
- if shell_result
101
- create_pattern_instance_variables(patterns, shell_result)
102
- else
103
- patterns.each { |instance, pattern| instance_variable_set("@#{instance}", 1) } # set all to 1 to show that an error occurred
104
- @message = "An exception occurred"
105
- end
106
- end
107
-
108
- end
109
- end
@@ -1,55 +0,0 @@
1
- module InfinityTest
2
- module TestLibrary
3
- class Bacon < TestFramework
4
- binary :bacon
5
- parse_results :specifications => /(\d+) specifications/, :requirements => /(\d+) requirements/, :failures => /(\d+) failure/, :errors => /(\d+) errors/
6
-
7
- # Bacon Framework
8
- #
9
- # For more information about the Bacon see: http://github.com/chneukirchen/bacon
10
- #
11
- # bacon = InfinityTest::Bacon.new(:rubies => '1.9.1,1.9.2')
12
- # bacon.rubies # => '1.9.1,1.9.2'
13
- # bacon.test_directory_pattern # => "^spec/*/(.*)_spec.rb"
14
- # bacon.test_pattern # => 'spec/**/*_spec.rb'
15
- #
16
- def initialize(options={})
17
- super(options)
18
- @test_pattern = 'spec/**/*_spec.rb'
19
- end
20
-
21
- # Construct all the commands for each ruby
22
- # First, try to find the bacon binary, and raise/puts an Error if don't find it.
23
- # After that, verifying if the user have a Gemfile, and if has, run with "bundle exec" command, else will run normally
24
- #
25
- def construct_rubies_commands(file=nil)
26
- commands = {}
27
- environments do |environment, ruby_version|
28
- bacon_binary = search_bacon(environment)
29
- command = construct_command(
30
- :for => ruby_version,
31
- :binary => bacon_binary,
32
- :load_path => 'lib:spec',
33
- :file => file,
34
- :environment => environment) || next
35
- commands[ruby_version] = command
36
- end
37
- commands
38
- end
39
-
40
- def sucess?
41
- return false if failure?
42
- true
43
- end
44
-
45
- def failure?
46
- @failures > 0
47
- end
48
-
49
- def pending?
50
- false # Don't have pending in Bacon
51
- end
52
-
53
- end
54
- end
55
- end
@@ -1,22 +0,0 @@
1
- module InfinityTest
2
- module TestLibrary
3
- class Cucumber < TestFramework
4
- include HeuristicsHelper
5
- binary :cucumber
6
- parse_results :passed => /(\d+) passed/, :failed => /(\d+) failed/
7
-
8
- def initialize
9
- add_heuristics!
10
- end
11
-
12
- def add_heuristics!
13
- heuristics do
14
- add("^features/*/*feature") do
15
- run :all => :tests, :in_dir => :steps_definitions
16
- end
17
- end
18
- end
19
-
20
- end
21
- end
22
- end
@@ -1,58 +0,0 @@
1
- module InfinityTest
2
- module TestLibrary
3
- class Rspec < TestFramework
4
- binary :rspec, :name => :rspec_two
5
- binary :spec, :name => :rspec_one
6
-
7
- parse_results :examples => /(\d+) example/, :failures => /(\d+) failure/, :pending => /(\d+) pending/
8
-
9
- #
10
- # rspec = InfinityTest::Rspec.new(:rubies => '1.9.1,1.9.2')
11
- # rspec.rubies # => '1.9.1,1.9.2'
12
- # rspec.test_pattern # => 'spec/**/*_spec.rb'
13
- #
14
- def initialize(options={})
15
- super(options)
16
- @test_pattern = 'spec/**/*_spec.rb'
17
- end
18
-
19
- # Construct all the commands for each ruby
20
- # First, try to find the rspec one binary, and if don't have installed
21
- # try to find rspec two, and raise/puts an Error if don't find it.
22
- # After that, verifying if the user have a Gemfile, and if has,
23
- # run with "bundle exec" command, else will run normally
24
- #
25
- def construct_rubies_commands(file=nil)
26
- commands = {}
27
- environments do |environment, ruby_version|
28
- rspec_binary = search_rspec_two(environment)
29
- rspec_binary = search_rspec_one(environment) unless have_binary?(rspec_binary)
30
- commands[ruby_version] = construct_command(
31
- :for => ruby_version,
32
- :binary => rspec_binary,
33
- :file => file,
34
- :environment => environment)
35
- end
36
- commands
37
- end
38
-
39
- def search_files(file_pattern)
40
- all_files.grep(/#{file_pattern}/i).join(' ')
41
- end
42
-
43
- def sucess?
44
- return false if failure? or pending?
45
- true
46
- end
47
-
48
- def failure?
49
- @failures > 0
50
- end
51
-
52
- def pending?
53
- @pending > 0 and not failure?
54
- end
55
-
56
- end
57
- end
58
- end
@@ -1,52 +0,0 @@
1
- module InfinityTest
2
- module TestLibrary
3
- class TestUnit < TestFramework
4
- parse_results :tests => /(\d+) tests/, :assertions => /(\d+) assertions/,
5
- :failures => /(\d+) failures/, :errors => /(\d+) errors/
6
-
7
- def initialize(options={})
8
- super(options)
9
- @test_pattern = 'test/**/*_test.rb'
10
- end
11
-
12
- def construct_rubies_commands(file=nil)
13
- command = {}
14
- environments do |environment, ruby_version|
15
- command[ruby_version] = construct_command(
16
- :for => ruby_version,
17
- :load_path => 'lib:test',
18
- :file => file,
19
- :environment => environment,
20
- :skip_binary? => true)
21
- end
22
- command
23
- end
24
-
25
- def test_files
26
- super.split.unshift(test_loader).sort.join(' ')
27
- end
28
-
29
- def decide_files(file)
30
- return file if file
31
- test_files
32
- end
33
-
34
-
35
- def test_loader
36
- $LOAD_PATH.each do |path|
37
- file_path = File.join(path, "infinity_test/test_unit_loader.rb")
38
- return file_path if File.exist?(file_path)
39
- end
40
- end
41
-
42
- def failure?
43
- @failures > 0 or @errors > 0
44
- end
45
-
46
- def pending?
47
- false # Don't have pending in Test::Unit right?? #doubt
48
- end
49
-
50
- end
51
- end
52
- end
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Load the test files from the command line.
4
-
5
- ARGV.each { |file| load file unless file =~ /^-/ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- infinity_test do
4
- use :rubies => ['1.8.7-p249' ,'1.9.1', '1.9.2'], :test_framework => :rspec
5
- end
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- infinity_test do
4
-
5
- use :rubies => ['1.8.7-p249' ,'1.9.1'], :test_framework => :test_unit
6
-
7
- end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,140 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module InfinityTest
4
- module ApplicationLibrary
5
- describe Rails do
6
- let(:rails) { Rails.new }
7
-
8
- describe '#lib_pattern' do
9
-
10
- it { rails.lib_pattern.should == "^lib/*/(.*)\.rb" }
11
-
12
- it "should be possible to change the library pattern" do
13
- rails.lib_pattern = "^another_lib/*/(.*)\.rb"
14
- rails.lib_pattern.should == "^another_lib/*/(.*)\.rb"
15
- end
16
-
17
- end
18
-
19
- describe '#test_pattern' do
20
-
21
- it "should return the pattern for Test::Unit" do
22
- stub_application_with_test_unit
23
- rails.test_pattern.should == "^test/*/(.*)_test.rb"
24
- end
25
-
26
- it "should return the pattern for Rspec " do
27
- stub_application_with_rspec
28
- rails.test_pattern.should == "^spec/*/(.*)_spec.rb"
29
- end
30
-
31
- end
32
-
33
- describe '#configuration_pattern' do
34
-
35
- it "should set to config/application.rb" do
36
- rails.configuration_pattern.should == "^config/application.rb"
37
- end
38
-
39
- it "should possible to change the configuration_pattern" do
40
- rails.configuration_pattern = "^config/environment.rb"
41
- rails.configuration_pattern.should == "^config/environment.rb"
42
- end
43
-
44
- end
45
-
46
- describe '#routes_pattern' do
47
-
48
- it "should return the routes_pattern" do
49
- rails.routes_pattern.should == "^config/routes\.rb"
50
- end
51
-
52
- it "should be possible to set the routes pattern" do
53
- rails.routes_pattern = "^config/routes_s\.rb"
54
- rails.routes_pattern.should == "^config/routes_s\.rb"
55
- end
56
-
57
- end
58
-
59
- describe '#fixtures_pattern' do
60
-
61
- it "should set the fixtures pattern" do
62
- stub_application_with_test_unit
63
- rails.fixtures_pattern.should == "^test/fixtures/(.*).yml"
64
- end
65
-
66
- it "should set a diferent fixtures pattern" do
67
- stub_application_with_rspec
68
- rails.fixtures_pattern.should == "^spec/fixtures/(.*).yml"
69
- end
70
-
71
- end
72
-
73
- describe '#controllers_pattern' do
74
-
75
- it "should set the controllers pattern" do
76
- rails.controllers_pattern.should == "^app/controllers/(.*)\.rb"
77
- end
78
-
79
- it "should be possible to set the controllers pattern" do
80
- rails.controllers_pattern = "^app/super_controllers/(.*)\.rb"
81
- rails.controllers_pattern.should == "^app/super_controllers/(.*)\.rb"
82
- end
83
-
84
- end
85
-
86
- describe '#helpers_pattern' do
87
- it "should return the controllers pattern" do
88
- rails.helpers_pattern.should == "^app/helpers/(.*)\.rb"
89
- end
90
-
91
- it "should be possible to set the controllers pattern" do
92
- rails.helpers_pattern = "^app/super_helpers/(.*)\.rb"
93
- rails.helpers_pattern.should == "^app/super_helpers/(.*)\.rb"
94
- end
95
- end
96
-
97
- describe '#mailers_pattern' do
98
-
99
- it "should return the controllers pattern" do
100
- rails.mailers_pattern.should == "^app/mailers/(.*)\.rb"
101
- end
102
-
103
- it "should be possible to set the controllers pattern" do
104
- rails.mailers_pattern = "^app/super_mailers/(.*)\.rb"
105
- rails.mailers_pattern.should == "^app/super_mailers/(.*)\.rb"
106
- end
107
-
108
- end
109
-
110
- describe '#application_controller_pattern' do
111
- it "should return the application controller" do
112
- rails.application_controller_pattern.should == "^app/controllers/application_controller.rb"
113
- end
114
- end
115
-
116
- describe '#application_helper_pattern' do
117
- it "should return the application_helper_pattern" do
118
- rails.application_helper_pattern.should == "^app/helpers/application_helper.rb"
119
- end
120
- it "should be possible to set the application helper pattern" do
121
- rails.application_helper_pattern = "my_pattern"
122
- rails.application_helper_pattern.should == "my_pattern"
123
- end
124
- end
125
-
126
- describe '#models_pattern' do
127
- it "should set the controllers pattern" do
128
- rails.models_pattern.should == "^app/models/(.*)\.rb"
129
- end
130
-
131
- it "should be possible to set the controllers pattern" do
132
- rails.models_pattern = "^app/super_models/(.*)\.rb"
133
- rails.models_pattern.should == "^app/super_models/(.*)\.rb"
134
- end
135
-
136
- end
137
-
138
- end
139
- end
140
- end
@@ -1,52 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module InfinityTest
4
- module ApplicationLibrary
5
- describe RubyGems do
6
- let(:rubygems) { RubyGems.new }
7
-
8
- describe '#application' do
9
- it { rubygems.application.should equal InfinityTest.application }
10
- end
11
-
12
- describe '#lib_pattern' do
13
-
14
- it { rubygems.lib_pattern.should == "^lib/*/(.*)\.rb" }
15
-
16
- it "should be possible to change the library pattern" do
17
- rubygems.lib_pattern = "^another_lib/*/(.*)\.rb"
18
- rubygems.lib_pattern.should == "^another_lib/*/(.*)\.rb"
19
- end
20
-
21
- end
22
-
23
- describe '#test_pattern' do
24
-
25
- it "should return the pattern for Test::Unit" do
26
- stub_application_with_test_unit
27
- rubygems.test_pattern.should == "^test/*/(.*)_test.rb"
28
- end
29
-
30
- it "should return the pattern for Rspec" do
31
- stub_application_with_rspec
32
- rubygems.test_pattern.should == "^spec/*/(.*)_spec.rb"
33
- end
34
-
35
- end
36
-
37
- describe '#test_helper_pattern' do
38
- it "should return the pattern for Test::Unit" do
39
- stub_application_with_test_unit
40
- rubygems.test_helper_pattern.should == "^test/*/test_helper.rb"
41
- end
42
-
43
- it "should return the pattern for Rspec" do
44
- stub_application_with_rspec
45
- rubygems.test_helper_pattern.should == "^spec/*/spec_helper.rb"
46
- end
47
-
48
- end
49
-
50
- end
51
- end
52
- end