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.
- checksums.yaml +7 -0
- data/.github/workflows/ci.yml +31 -0
- data/.gitignore +3 -0
- data/.rspec +2 -2
- data/AI_INTEGRATION_IDEAS.md +203 -0
- data/Gemfile +3 -15
- data/History.markdown +82 -0
- data/INFINITY_TEST +48 -0
- data/LICENSE.txt +2 -2
- data/README.md +627 -0
- data/Rakefile +1 -65
- data/TODO.markdown +26 -9
- data/bin/infinity_test +1 -4
- data/images/fuuu/pending.png +0 -0
- data/images/fuuu/success.png +0 -0
- data/infinity_test.gemspec +41 -191
- data/lib/infinity_test/core/auto_discover.rb +67 -0
- data/lib/infinity_test/core/base.rb +369 -0
- data/lib/infinity_test/core/callback.rb +59 -0
- data/lib/infinity_test/core/changed_file.rb +13 -0
- data/lib/infinity_test/core/command_builder.rb +48 -0
- data/lib/infinity_test/core/command_runner.rb +62 -0
- data/lib/infinity_test/core/configuration_merge.rb +37 -0
- data/lib/infinity_test/core/continuous_test_server.rb +106 -0
- data/lib/infinity_test/core/load_configuration.rb +48 -0
- data/lib/infinity_test/core/notifier.rb +59 -0
- data/lib/infinity_test/core/options.rb +134 -0
- data/lib/infinity_test/core/runner.rb +18 -0
- data/lib/infinity_test/core/version.rb +5 -0
- data/lib/infinity_test/framework/base.rb +57 -0
- data/lib/infinity_test/framework/padrino.rb +33 -0
- data/lib/infinity_test/framework/rails.rb +35 -0
- data/lib/infinity_test/framework/rubygems.rb +29 -0
- data/lib/infinity_test/framework/shared_example.rb +47 -0
- data/lib/infinity_test/observer/base.rb +40 -0
- data/lib/infinity_test/observer/filewatcher.rb +72 -0
- data/lib/infinity_test/observer/listen.rb +74 -0
- data/lib/infinity_test/observer/shared_example.rb +35 -0
- data/lib/infinity_test/old_dsl/configuration.rb +26 -0
- data/lib/infinity_test/strategy/base.rb +34 -0
- data/lib/infinity_test/strategy/rbenv.rb +32 -0
- data/lib/infinity_test/strategy/ruby_default.rb +20 -0
- data/lib/infinity_test/strategy/rvm.rb +50 -0
- data/lib/infinity_test/strategy/shared_example.rb +32 -0
- data/lib/infinity_test/test_framework/base.rb +64 -0
- data/lib/infinity_test/test_framework/rspec.rb +48 -0
- data/lib/infinity_test/test_framework/shared_example.rb +56 -0
- data/lib/infinity_test/test_framework/test_unit.rb +57 -0
- data/lib/infinity_test.rb +53 -35
- data/spec/infinity_test/core/auto_discover_spec.rb +149 -0
- data/spec/infinity_test/core/base_spec.rb +240 -0
- data/spec/infinity_test/core/callback_spec.rb +89 -0
- data/spec/infinity_test/core/changed_file_spec.rb +26 -0
- data/spec/infinity_test/core/command_builder_spec.rb +38 -0
- data/spec/infinity_test/core/configuration_merge_spec.rb +124 -0
- data/spec/infinity_test/core/continuous_test_server_spec.rb +116 -0
- data/spec/infinity_test/core/load_configuration_spec.rb +43 -0
- data/spec/infinity_test/core/notifier_spec.rb +151 -0
- data/spec/infinity_test/core/options_spec.rb +168 -0
- data/spec/infinity_test/core/runner_spec.rb +17 -0
- data/spec/infinity_test/framework/base_spec.rb +55 -0
- data/spec/infinity_test/framework/padrino_spec.rb +36 -0
- data/spec/infinity_test/framework/rails_spec.rb +36 -0
- data/spec/infinity_test/framework/rubygems_spec.rb +34 -0
- data/spec/infinity_test/observer/base_spec.rb +78 -0
- data/spec/infinity_test/observer/filewatcher_spec.rb +51 -0
- data/spec/infinity_test/observer/listen_spec.rb +50 -0
- data/spec/infinity_test/{builder_spec.rb → strategy/base_spec.rb} +1 -2
- data/spec/infinity_test/strategy/rbenv_spec.rb +53 -0
- data/spec/infinity_test/strategy/ruby_default_spec.rb +32 -0
- data/spec/infinity_test/strategy/rvm_spec.rb +69 -0
- data/spec/infinity_test/test_framework/rspec_spec.rb +119 -0
- data/spec/infinity_test/test_framework/test_unit_spec.rb +193 -0
- data/spec/spec_helper.rb +34 -119
- metadata +276 -205
- data/.infinity_test +0 -36
- data/.rvmrc +0 -1
- data/Gemfile.lock +0 -62
- data/Readme.markdown +0 -122
- data/Tasks +0 -4
- data/VERSION.yml +0 -5
- data/buzz_images/buzz_lightyear.jpg +0 -0
- data/buzz_images/buzz_lightyear_continencia.gif +0 -0
- data/buzz_images/to_infinity_and_beyond.png +0 -0
- data/features/heuristics.feature +0 -23
- data/features/support/env.rb +0 -2
- data/images/fuuu/sucess.png +0 -0
- data/lib/infinity_test/application.rb +0 -355
- data/lib/infinity_test/application_library/rails.rb +0 -94
- data/lib/infinity_test/application_library/rubygems.rb +0 -43
- data/lib/infinity_test/binary_path.rb +0 -43
- data/lib/infinity_test/builder.rb +0 -67
- data/lib/infinity_test/command.rb +0 -58
- data/lib/infinity_test/configuration.rb +0 -273
- data/lib/infinity_test/continuous_testing.rb +0 -40
- data/lib/infinity_test/dependencies.rb +0 -80
- data/lib/infinity_test/environment.rb +0 -15
- data/lib/infinity_test/heuristics.rb +0 -36
- data/lib/infinity_test/heuristics_helper.rb +0 -9
- data/lib/infinity_test/options.rb +0 -89
- data/lib/infinity_test/runner.rb +0 -38
- data/lib/infinity_test/test_framework.rb +0 -109
- data/lib/infinity_test/test_library/bacon.rb +0 -55
- data/lib/infinity_test/test_library/cucumber.rb +0 -22
- data/lib/infinity_test/test_library/rspec.rb +0 -58
- data/lib/infinity_test/test_library/test_unit.rb +0 -52
- data/lib/infinity_test/test_unit_loader.rb +0 -5
- data/spec/factories/buzz/lib/buzz.rb +0 -0
- data/spec/factories/buzz/spec/buzz_spec.rb +0 -0
- data/spec/factories/company/Gemfile +0 -0
- data/spec/factories/company/lib/company.rb +0 -0
- data/spec/factories/company/test/company_test.rb +0 -0
- data/spec/factories/images/failure.png +0 -0
- data/spec/factories/images/pending.png +0 -0
- data/spec/factories/images/sucess.png +0 -0
- data/spec/factories/infinity_test +0 -5
- data/spec/factories/infinity_test_example +0 -7
- data/spec/factories/slinky/spec/slinky/slinky_spec.rb +0 -0
- data/spec/factories/travel/lib/travel.rb +0 -0
- data/spec/factories/travel/test/partner_test.rb +0 -0
- data/spec/factories/travel/test/travel_test.rb +0 -0
- data/spec/factories/wood/lib/wood.rb +0 -0
- data/spec/factories/wood/spec/wood_spec.rb +0 -0
- data/spec/infinity_test/application_library/rails_spec.rb +0 -140
- data/spec/infinity_test/application_library/rubygems_spec.rb +0 -52
- data/spec/infinity_test/application_spec.rb +0 -424
- data/spec/infinity_test/binary_path_spec.rb +0 -72
- data/spec/infinity_test/command_spec.rb +0 -53
- data/spec/infinity_test/configuration_spec.rb +0 -377
- data/spec/infinity_test/continuous_testing_spec.rb +0 -25
- data/spec/infinity_test/environment_spec.rb +0 -23
- data/spec/infinity_test/heuristics_helper_spec.rb +0 -15
- data/spec/infinity_test/heuristics_spec.rb +0 -127
- data/spec/infinity_test/options_spec.rb +0 -91
- data/spec/infinity_test/runner_spec.rb +0 -42
- data/spec/infinity_test/test_framework_spec.rb +0 -127
- data/spec/infinity_test/test_library/bacon_spec.rb +0 -150
- data/spec/infinity_test/test_library/cucumber_spec.rb +0 -8
- data/spec/infinity_test/test_library/rspec_spec.rb +0 -185
- data/spec/infinity_test/test_library/test_unit_spec.rb +0 -184
- data/spec/infinity_test_spec.rb +0 -40
- /data/images/faces/{sucess.png → success.png} +0 -0
- /data/images/hands/{sucess.png → success.png} +0 -0
- /data/images/mario_bros/{sucess.jpg → success.jpg} +0 -0
- /data/images/rails/{sucess.png → success.png} +0 -0
- /data/images/rubies/{sucess.png → success.png} +0 -0
- /data/images/simpson/{sucess.jpg → success.jpg} +0 -0
- /data/images/street_fighter/{sucess.jpg → success.jpg} +0 -0
- /data/images/toy_story/{sucess.png → success.png} +0 -0
data/TODO.markdown
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
======
|
|
1
|
+
## Todo
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
- Support Cucumber
|
|
6
|
-
- Make Infinity Test support Rubinius (I tried to run without success - Investigate this!)
|
|
7
|
-
- Run with failed tests (Focus mode!!)
|
|
3
|
+
Infinity test is a gem that watch files changes and run tests.
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
That also can run with different ruby versions all test suite or only that file change (using rvm or
|
|
6
|
+
rbenv), ruby default just run the test on the current ruby version.
|
|
11
7
|
|
|
12
|
-
|
|
8
|
+
## What Needs to Be Done
|
|
9
|
+
|
|
10
|
+
* ~~Make notifications work with Notifiers gem (remove growl and use the autodiscover from notifiers gem).~~ DONE
|
|
11
|
+
* ~~Change .infinity_test to INFINITY_TEST~~ DONE
|
|
12
|
+
* ~~Make Test::Unit to work (the infinity test to check test folder).~~ DONE
|
|
13
|
+
* ~~Make RSpec work~~ DONE
|
|
14
|
+
* ~~Finish RubyDefault strategy~~ DONE
|
|
15
|
+
* ~~Finish RVM (running different versions - the user need to specify)~~ DONE
|
|
16
|
+
* ~~Finish RbEnv (running different versions - the user need to specify)~~ DONE
|
|
17
|
+
* Make callbacks work in the new structure (loading the infinity test file).
|
|
18
|
+
* ~~Finish Gem autodiscover and its changes heuristics.~~ DONE
|
|
19
|
+
* ~~Finish Rails autodiscover and its changes heuristics.~~ DONE
|
|
20
|
+
* ~~Padrino autodiscover and its changes heuristics.~~ DONE
|
|
21
|
+
* ~~Improve auto discover feature priorization subclasses for #run? method.~~ DONE
|
|
22
|
+
* ~~Focus feature(fails, pass one file, run entire suite) with --focus (experimented feature)!~~ DONE
|
|
23
|
+
* ~~Add post-run hooks to be added to the INFINITY_TEST file that run other things (coverage, code
|
|
24
|
+
analysis, etc - see ideas)~~ DONE (via callbacks system)
|
|
25
|
+
|
|
26
|
+
* ~~Give some ideas (write to a md file the ideas) about how to integrate the infinity test with AI tools/AI agents or
|
|
27
|
+
even Claude code ... so ruby developers can see~~ DONE (see AI_INTEGRATION_IDEAS.md)
|
|
28
|
+
|
|
29
|
+
* ~~Update HISTORY with all changes since last version.~~ DONE
|
data/bin/infinity_test
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
infinity_test_directory = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
4
|
-
$LOAD_PATH.unshift(infinity_test_directory) unless $LOAD_PATH.include?(infinity_test_directory)
|
|
5
|
-
|
|
6
3
|
require 'infinity_test'
|
|
7
|
-
InfinityTest.start
|
|
4
|
+
InfinityTest::Runner.new(ARGV).start
|
data/images/fuuu/pending.png
CHANGED
|
Binary file
|
|
Binary file
|
data/infinity_test.gemspec
CHANGED
|
@@ -1,202 +1,52 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Gem::Specification.new do |
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"bin/infinity_test",
|
|
35
|
-
"buzz_images/buzz_lightyear.jpg",
|
|
36
|
-
"buzz_images/buzz_lightyear_continencia.gif",
|
|
37
|
-
"buzz_images/to_infinity_and_beyond.png",
|
|
38
|
-
"features/heuristics.feature",
|
|
39
|
-
"features/support/env.rb",
|
|
40
|
-
"images/faces/failure.png",
|
|
41
|
-
"images/faces/pending.png",
|
|
42
|
-
"images/faces/sucess.png",
|
|
43
|
-
"images/fuuu/failure.png",
|
|
44
|
-
"images/fuuu/pending.png",
|
|
45
|
-
"images/fuuu/sucess.png",
|
|
46
|
-
"images/hands/failure.png",
|
|
47
|
-
"images/hands/pending.png",
|
|
48
|
-
"images/hands/sucess.png",
|
|
49
|
-
"images/mario_bros/failure.jpg",
|
|
50
|
-
"images/mario_bros/pending.jpg",
|
|
51
|
-
"images/mario_bros/sucess.jpg",
|
|
52
|
-
"images/rails/failure.png",
|
|
53
|
-
"images/rails/pending.png",
|
|
54
|
-
"images/rails/sucess.png",
|
|
55
|
-
"images/rubies/failure.png",
|
|
56
|
-
"images/rubies/pending.png",
|
|
57
|
-
"images/rubies/sucess.png",
|
|
58
|
-
"images/simpson/failure.gif",
|
|
59
|
-
"images/simpson/pending.jpg",
|
|
60
|
-
"images/simpson/sucess.jpg",
|
|
61
|
-
"images/street_fighter/failure.gif",
|
|
62
|
-
"images/street_fighter/pending.gif",
|
|
63
|
-
"images/street_fighter/sucess.jpg",
|
|
64
|
-
"images/toy_story/failure.gif",
|
|
65
|
-
"images/toy_story/pending.png",
|
|
66
|
-
"images/toy_story/sucess.png",
|
|
67
|
-
"infinity_test.gemspec",
|
|
68
|
-
"lib/infinity_test.rb",
|
|
69
|
-
"lib/infinity_test/application.rb",
|
|
70
|
-
"lib/infinity_test/application_library/rails.rb",
|
|
71
|
-
"lib/infinity_test/application_library/rubygems.rb",
|
|
72
|
-
"lib/infinity_test/binary_path.rb",
|
|
73
|
-
"lib/infinity_test/builder.rb",
|
|
74
|
-
"lib/infinity_test/command.rb",
|
|
75
|
-
"lib/infinity_test/configuration.rb",
|
|
76
|
-
"lib/infinity_test/continuous_testing.rb",
|
|
77
|
-
"lib/infinity_test/dependencies.rb",
|
|
78
|
-
"lib/infinity_test/environment.rb",
|
|
79
|
-
"lib/infinity_test/heuristics.rb",
|
|
80
|
-
"lib/infinity_test/heuristics_helper.rb",
|
|
81
|
-
"lib/infinity_test/options.rb",
|
|
82
|
-
"lib/infinity_test/runner.rb",
|
|
83
|
-
"lib/infinity_test/test_framework.rb",
|
|
84
|
-
"lib/infinity_test/test_library/bacon.rb",
|
|
85
|
-
"lib/infinity_test/test_library/cucumber.rb",
|
|
86
|
-
"lib/infinity_test/test_library/rspec.rb",
|
|
87
|
-
"lib/infinity_test/test_library/test_unit.rb",
|
|
88
|
-
"lib/infinity_test/test_unit_loader.rb",
|
|
89
|
-
"spec/factories/buzz/lib/buzz.rb",
|
|
90
|
-
"spec/factories/buzz/spec/buzz_spec.rb",
|
|
91
|
-
"spec/factories/company/Gemfile",
|
|
92
|
-
"spec/factories/company/lib/company.rb",
|
|
93
|
-
"spec/factories/company/test/company_test.rb",
|
|
94
|
-
"spec/factories/images/failure.png",
|
|
95
|
-
"spec/factories/images/pending.png",
|
|
96
|
-
"spec/factories/images/sucess.png",
|
|
97
|
-
"spec/factories/infinity_test",
|
|
98
|
-
"spec/factories/infinity_test_example",
|
|
99
|
-
"spec/factories/slinky/spec/slinky/slinky_spec.rb",
|
|
100
|
-
"spec/factories/travel/lib/travel.rb",
|
|
101
|
-
"spec/factories/travel/test/partner_test.rb",
|
|
102
|
-
"spec/factories/travel/test/travel_test.rb",
|
|
103
|
-
"spec/factories/wood/lib/wood.rb",
|
|
104
|
-
"spec/factories/wood/spec/wood_spec.rb",
|
|
105
|
-
"spec/infinity_test/application_library/rails_spec.rb",
|
|
106
|
-
"spec/infinity_test/application_library/rubygems_spec.rb",
|
|
107
|
-
"spec/infinity_test/application_spec.rb",
|
|
108
|
-
"spec/infinity_test/binary_path_spec.rb",
|
|
109
|
-
"spec/infinity_test/builder_spec.rb",
|
|
110
|
-
"spec/infinity_test/command_spec.rb",
|
|
111
|
-
"spec/infinity_test/configuration_spec.rb",
|
|
112
|
-
"spec/infinity_test/continuous_testing_spec.rb",
|
|
113
|
-
"spec/infinity_test/environment_spec.rb",
|
|
114
|
-
"spec/infinity_test/heuristics_helper_spec.rb",
|
|
115
|
-
"spec/infinity_test/heuristics_spec.rb",
|
|
116
|
-
"spec/infinity_test/options_spec.rb",
|
|
117
|
-
"spec/infinity_test/runner_spec.rb",
|
|
118
|
-
"spec/infinity_test/test_framework_spec.rb",
|
|
119
|
-
"spec/infinity_test/test_library/bacon_spec.rb",
|
|
120
|
-
"spec/infinity_test/test_library/cucumber_spec.rb",
|
|
121
|
-
"spec/infinity_test/test_library/rspec_spec.rb",
|
|
122
|
-
"spec/infinity_test/test_library/test_unit_spec.rb",
|
|
123
|
-
"spec/infinity_test_spec.rb",
|
|
124
|
-
"spec/spec_helper.rb"
|
|
125
|
-
]
|
|
126
|
-
s.homepage = %q{http://github.com/tomas-stefano/infinity_test}
|
|
127
|
-
s.post_install_message = %q{
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'infinity_test/core/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = 'infinity_test'
|
|
8
|
+
spec.version = InfinityTest::Core::VERSION
|
|
9
|
+
spec.authors = ["Tomas D'Stefano"]
|
|
10
|
+
spec.email = ['tomas_stefano@successoft.com']
|
|
11
|
+
spec.description = 'Infinity Test is a continuous testing library and a flexible alternative to Autotest and Guard.'
|
|
12
|
+
spec.summary = 'Infinity Test is a continuous testing library and a flexible alternative to Autotest and Guard.'
|
|
13
|
+
spec.homepage = 'https://github.com/tomas-stefano/infinity_test'
|
|
14
|
+
spec.license = 'MIT'
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files`.split($/)
|
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
spec.require_paths = ['lib']
|
|
20
|
+
|
|
21
|
+
spec.add_dependency 'activesupport'
|
|
22
|
+
spec.add_dependency 'listen'
|
|
23
|
+
spec.add_dependency 'filewatcher'
|
|
24
|
+
spec.add_dependency 'hike'
|
|
25
|
+
spec.add_dependency 'notifiers'
|
|
26
|
+
|
|
27
|
+
spec.add_development_dependency 'bundler'
|
|
28
|
+
spec.add_development_dependency 'rake'
|
|
29
|
+
spec.add_development_dependency 'rspec'
|
|
30
|
+
spec.add_development_dependency 'simplecov'
|
|
31
|
+
spec.add_development_dependency 'pry'
|
|
32
|
+
|
|
33
|
+
spec.post_install_message = %q{
|
|
128
34
|
--------------------------------------------------------------------------------
|
|
129
35
|
T O I N F I N I T Y A N D B E Y O N D !!!
|
|
130
36
|
|
|
131
|
-
|
|
132
|
-
If you don't have
|
|
37
|
+
Infinity Test can be used with RVM, RbEnv or just Ruby without package manager.
|
|
38
|
+
If you don't have RVM or Rbenv installed.
|
|
39
|
+
|
|
133
40
|
RVM Installation Instructions:
|
|
134
|
-
|
|
41
|
+
https://rvm.io/rvm/install/
|
|
42
|
+
|
|
43
|
+
Rbenv Installation Instructions:
|
|
44
|
+
https://github.com/sstephenson/rbenv#installation
|
|
45
|
+
|
|
135
46
|
And don't forget to see how you can customize Infinity Test here:
|
|
136
47
|
http://github.com/tomas-stefano/infinity_test/wiki/Customize-Infinity-Test
|
|
137
48
|
|
|
138
49
|
Happy Coding! :)
|
|
139
|
-
|
|
140
50
|
--------------------------------------------------------------------------------
|
|
141
|
-
|
|
142
51
|
}
|
|
143
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
|
144
|
-
s.require_paths = ["lib"]
|
|
145
|
-
s.rubygems_version = %q{1.3.7}
|
|
146
|
-
s.summary = %q{Continuous testing and a flexible alternative to Autotest using watchr and RVM}
|
|
147
|
-
s.test_files = [
|
|
148
|
-
"spec/factories/buzz/lib/buzz.rb",
|
|
149
|
-
"spec/factories/buzz/spec/buzz_spec.rb",
|
|
150
|
-
"spec/factories/company/lib/company.rb",
|
|
151
|
-
"spec/factories/company/test/company_test.rb",
|
|
152
|
-
"spec/factories/slinky/spec/slinky/slinky_spec.rb",
|
|
153
|
-
"spec/factories/travel/lib/travel.rb",
|
|
154
|
-
"spec/factories/travel/test/partner_test.rb",
|
|
155
|
-
"spec/factories/travel/test/travel_test.rb",
|
|
156
|
-
"spec/factories/wood/lib/wood.rb",
|
|
157
|
-
"spec/factories/wood/spec/wood_spec.rb",
|
|
158
|
-
"spec/infinity_test/application_library/rails_spec.rb",
|
|
159
|
-
"spec/infinity_test/application_library/rubygems_spec.rb",
|
|
160
|
-
"spec/infinity_test/application_spec.rb",
|
|
161
|
-
"spec/infinity_test/binary_path_spec.rb",
|
|
162
|
-
"spec/infinity_test/builder_spec.rb",
|
|
163
|
-
"spec/infinity_test/command_spec.rb",
|
|
164
|
-
"spec/infinity_test/configuration_spec.rb",
|
|
165
|
-
"spec/infinity_test/continuous_testing_spec.rb",
|
|
166
|
-
"spec/infinity_test/environment_spec.rb",
|
|
167
|
-
"spec/infinity_test/heuristics_helper_spec.rb",
|
|
168
|
-
"spec/infinity_test/heuristics_spec.rb",
|
|
169
|
-
"spec/infinity_test/options_spec.rb",
|
|
170
|
-
"spec/infinity_test/runner_spec.rb",
|
|
171
|
-
"spec/infinity_test/test_framework_spec.rb",
|
|
172
|
-
"spec/infinity_test/test_library/bacon_spec.rb",
|
|
173
|
-
"spec/infinity_test/test_library/cucumber_spec.rb",
|
|
174
|
-
"spec/infinity_test/test_library/rspec_spec.rb",
|
|
175
|
-
"spec/infinity_test/test_library/test_unit_spec.rb",
|
|
176
|
-
"spec/infinity_test_spec.rb",
|
|
177
|
-
"spec/spec_helper.rb"
|
|
178
|
-
]
|
|
179
|
-
|
|
180
|
-
if s.respond_to? :specification_version then
|
|
181
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
182
|
-
s.specification_version = 3
|
|
183
|
-
|
|
184
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
185
|
-
s.add_runtime_dependency(%q<watchr>, [">= 0.7"])
|
|
186
|
-
s.add_runtime_dependency(%q<notifiers>, [">= 1.1.0"])
|
|
187
|
-
s.add_development_dependency(%q<rspec>, [">= 2.0.1"])
|
|
188
|
-
s.add_development_dependency(%q<jeweler>, [">= 1.4.0"])
|
|
189
|
-
else
|
|
190
|
-
s.add_dependency(%q<watchr>, [">= 0.7"])
|
|
191
|
-
s.add_dependency(%q<notifiers>, [">= 1.1.0"])
|
|
192
|
-
s.add_dependency(%q<rspec>, [">= 2.0.1"])
|
|
193
|
-
s.add_dependency(%q<jeweler>, [">= 1.4.0"])
|
|
194
|
-
end
|
|
195
|
-
else
|
|
196
|
-
s.add_dependency(%q<watchr>, [">= 0.7"])
|
|
197
|
-
s.add_dependency(%q<notifiers>, [">= 1.1.0"])
|
|
198
|
-
s.add_dependency(%q<rspec>, [">= 2.0.1"])
|
|
199
|
-
s.add_dependency(%q<jeweler>, [">= 1.4.0"])
|
|
200
|
-
end
|
|
201
52
|
end
|
|
202
|
-
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
module InfinityTest
|
|
2
|
+
module Core
|
|
3
|
+
class AutoDiscover
|
|
4
|
+
attr_reader :base
|
|
5
|
+
|
|
6
|
+
# Priority order for auto discovery (higher priority first)
|
|
7
|
+
# More specific libraries should be checked before generic ones
|
|
8
|
+
PRIORITY = {
|
|
9
|
+
strategy: [:rvm, :rbenv, :ruby_default],
|
|
10
|
+
framework: [:rails, :padrino, :rubygems],
|
|
11
|
+
test_framework: [:rspec, :test_unit]
|
|
12
|
+
}.freeze
|
|
13
|
+
|
|
14
|
+
def initialize(base)
|
|
15
|
+
@base = base
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def discover_libraries
|
|
19
|
+
discover_strategy
|
|
20
|
+
discover_framework
|
|
21
|
+
discover_test_framework
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def discover_strategy
|
|
25
|
+
base.strategy = auto_discover(:strategy) if base.strategy.equal?(:auto_discover)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def discover_framework
|
|
29
|
+
base.framework = auto_discover(:framework) if base.framework.equal?(:auto_discover)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def discover_test_framework
|
|
33
|
+
base.test_framework = auto_discover(:test_framework) if base.test_framework.equal?(:auto_discover)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
private
|
|
37
|
+
|
|
38
|
+
def auto_discover(library_type)
|
|
39
|
+
library_base_class = "InfinityTest::#{library_type.to_s.camelize}::Base".constantize
|
|
40
|
+
subclasses = library_base_class.subclasses
|
|
41
|
+
priority_order = PRIORITY[library_type] || []
|
|
42
|
+
|
|
43
|
+
# Sort subclasses by priority (known priorities first, unknown last)
|
|
44
|
+
sorted_subclasses = subclasses.sort_by do |subclass|
|
|
45
|
+
name = subclass.name.demodulize.underscore.to_sym
|
|
46
|
+
priority_order.index(name) || priority_order.length
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
library = sorted_subclasses.find { |subclass| subclass.run? }
|
|
50
|
+
|
|
51
|
+
if library.present?
|
|
52
|
+
library.name.demodulize.underscore.to_sym
|
|
53
|
+
else
|
|
54
|
+
message = %{
|
|
55
|
+
|
|
56
|
+
The InfinityTest::Core::AutoDiscover doesn't discover nothing to run.
|
|
57
|
+
Are you using a #{library_type} that Infinity test knows?
|
|
58
|
+
|
|
59
|
+
Infinity Test #{library_type.to_s.pluralize}: #{library_base_class.subclasses.map(&:name).join(', ')}
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
raise Exception, message
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|