infinity_test 1.0.3 → 2.0.0.rc2

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 (175) 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.md +84 -0
  8. data/History.markdown +82 -0
  9. data/{.infinity_test → INFINITY_TEST} +18 -15
  10. data/LICENSE.txt +2 -2
  11. data/README.md +867 -0
  12. data/Rakefile +1 -65
  13. data/TODO.markdown +38 -24
  14. data/bin/infinity_test +1 -4
  15. data/images/fuuu/pending.png +0 -0
  16. data/images/fuuu/success.png +0 -0
  17. data/infinity_test.gemspec +41 -189
  18. data/lib/infinity_test/core/auto_discover.rb +67 -0
  19. data/lib/infinity_test/core/base.rb +369 -0
  20. data/lib/infinity_test/core/callback.rb +59 -0
  21. data/lib/infinity_test/core/changed_file.rb +13 -0
  22. data/lib/infinity_test/core/command_builder.rb +48 -0
  23. data/lib/infinity_test/core/command_runner.rb +38 -0
  24. data/lib/infinity_test/core/configuration_merge.rb +37 -0
  25. data/lib/infinity_test/core/continuous_test_server.rb +124 -0
  26. data/lib/infinity_test/core/load_configuration.rb +48 -0
  27. data/lib/infinity_test/core/notifier.rb +59 -0
  28. data/lib/infinity_test/core/options.rb +134 -0
  29. data/lib/infinity_test/core/runner.rb +18 -0
  30. data/lib/infinity_test/core/version.rb +5 -0
  31. data/lib/infinity_test/framework/base.rb +93 -0
  32. data/lib/infinity_test/framework/django.rb +109 -0
  33. data/lib/infinity_test/framework/elixir_mix.rb +47 -0
  34. data/lib/infinity_test/framework/fast_api.rb +104 -0
  35. data/lib/infinity_test/framework/padrino.rb +30 -0
  36. data/lib/infinity_test/framework/phoenix.rb +72 -0
  37. data/lib/infinity_test/framework/python_package.rb +97 -0
  38. data/lib/infinity_test/framework/rails.rb +26 -0
  39. data/lib/infinity_test/framework/rocket.rb +70 -0
  40. data/lib/infinity_test/framework/rubygems.rb +29 -0
  41. data/lib/infinity_test/framework/rust_cargo.rb +69 -0
  42. data/lib/infinity_test/framework/shared_example.rb +47 -0
  43. data/lib/infinity_test/observer/base.rb +40 -0
  44. data/lib/infinity_test/observer/filewatcher.rb +72 -0
  45. data/lib/infinity_test/observer/listen.rb +74 -0
  46. data/lib/infinity_test/observer/shared_example.rb +35 -0
  47. data/lib/infinity_test/old_dsl/configuration.rb +26 -0
  48. data/lib/infinity_test/strategy/base.rb +50 -0
  49. data/lib/infinity_test/strategy/elixir_default.rb +20 -0
  50. data/lib/infinity_test/strategy/python_default.rb +22 -0
  51. data/lib/infinity_test/strategy/rbenv.rb +34 -0
  52. data/lib/infinity_test/strategy/ruby_default.rb +21 -0
  53. data/lib/infinity_test/strategy/rust_default.rb +21 -0
  54. data/lib/infinity_test/strategy/rvm.rb +52 -0
  55. data/lib/infinity_test/strategy/shared_example.rb +32 -0
  56. data/lib/infinity_test/test_framework/base.rb +64 -0
  57. data/lib/infinity_test/test_framework/cargo_test.rb +49 -0
  58. data/lib/infinity_test/test_framework/ex_unit.rb +53 -0
  59. data/lib/infinity_test/test_framework/pytest.rb +65 -0
  60. data/lib/infinity_test/test_framework/rspec.rb +48 -0
  61. data/lib/infinity_test/test_framework/shared_example.rb +56 -0
  62. data/lib/infinity_test/test_framework/test_unit.rb +57 -0
  63. data/lib/infinity_test.rb +66 -35
  64. data/spec/infinity_test/core/auto_discover_spec.rb +175 -0
  65. data/spec/infinity_test/core/base_spec.rb +240 -0
  66. data/spec/infinity_test/core/callback_spec.rb +89 -0
  67. data/spec/infinity_test/core/changed_file_spec.rb +26 -0
  68. data/spec/infinity_test/core/command_builder_spec.rb +38 -0
  69. data/spec/infinity_test/core/configuration_merge_spec.rb +124 -0
  70. data/spec/infinity_test/core/continuous_test_server_spec.rb +116 -0
  71. data/spec/infinity_test/core/load_configuration_spec.rb +43 -0
  72. data/spec/infinity_test/core/notifier_spec.rb +151 -0
  73. data/spec/infinity_test/core/options_spec.rb +168 -0
  74. data/spec/infinity_test/core/runner_spec.rb +17 -0
  75. data/spec/infinity_test/framework/base_spec.rb +55 -0
  76. data/spec/infinity_test/framework/django_spec.rb +95 -0
  77. data/spec/infinity_test/framework/elixir_mix_spec.rb +44 -0
  78. data/spec/infinity_test/framework/fast_api_spec.rb +96 -0
  79. data/spec/infinity_test/framework/padrino_spec.rb +58 -0
  80. data/spec/infinity_test/framework/phoenix_spec.rb +85 -0
  81. data/spec/infinity_test/framework/python_package_spec.rb +95 -0
  82. data/spec/infinity_test/framework/rails_spec.rb +58 -0
  83. data/spec/infinity_test/framework/rocket_spec.rb +69 -0
  84. data/spec/infinity_test/framework/rubygems_spec.rb +34 -0
  85. data/spec/infinity_test/framework/rust_cargo_spec.rb +94 -0
  86. data/spec/infinity_test/observer/base_spec.rb +78 -0
  87. data/spec/infinity_test/observer/filewatcher_spec.rb +51 -0
  88. data/spec/infinity_test/observer/listen_spec.rb +50 -0
  89. data/spec/infinity_test/{builder_spec.rb → strategy/base_spec.rb} +1 -2
  90. data/spec/infinity_test/strategy/elixir_default_spec.rb +46 -0
  91. data/spec/infinity_test/strategy/python_default_spec.rb +56 -0
  92. data/spec/infinity_test/strategy/rbenv_spec.rb +70 -0
  93. data/spec/infinity_test/strategy/ruby_default_spec.rb +49 -0
  94. data/spec/infinity_test/strategy/rust_default_spec.rb +56 -0
  95. data/spec/infinity_test/strategy/rvm_spec.rb +86 -0
  96. data/spec/infinity_test/test_framework/cargo_test_spec.rb +145 -0
  97. data/spec/infinity_test/test_framework/ex_unit_spec.rb +153 -0
  98. data/spec/infinity_test/test_framework/pytest_spec.rb +182 -0
  99. data/spec/infinity_test/test_framework/rspec_spec.rb +119 -0
  100. data/spec/infinity_test/test_framework/test_unit_spec.rb +193 -0
  101. data/spec/spec_helper.rb +34 -119
  102. metadata +315 -177
  103. data/.rvmrc +0 -1
  104. data/Gemfile.lock +0 -62
  105. data/Readme.markdown +0 -147
  106. data/Tasks +0 -4
  107. data/VERSION.yml +0 -5
  108. data/buzz_images/buzz_lightyear.jpg +0 -0
  109. data/buzz_images/buzz_lightyear_continencia.gif +0 -0
  110. data/buzz_images/to_infinity_and_beyond.png +0 -0
  111. data/features/heuristics.feature +0 -23
  112. data/features/support/env.rb +0 -2
  113. data/images/fuuu/sucess.png +0 -0
  114. data/lib/infinity_test/application.rb +0 -362
  115. data/lib/infinity_test/application_library/rails.rb +0 -94
  116. data/lib/infinity_test/application_library/rubygems.rb +0 -43
  117. data/lib/infinity_test/binary_path.rb +0 -43
  118. data/lib/infinity_test/builder.rb +0 -66
  119. data/lib/infinity_test/command.rb +0 -58
  120. data/lib/infinity_test/configuration.rb +0 -277
  121. data/lib/infinity_test/continuous_testing.rb +0 -40
  122. data/lib/infinity_test/dependencies.rb +0 -80
  123. data/lib/infinity_test/environment.rb +0 -15
  124. data/lib/infinity_test/heuristics.rb +0 -36
  125. data/lib/infinity_test/heuristics_helper.rb +0 -9
  126. data/lib/infinity_test/options.rb +0 -96
  127. data/lib/infinity_test/runner.rb +0 -38
  128. data/lib/infinity_test/test_framework.rb +0 -110
  129. data/lib/infinity_test/test_library/bacon.rb +0 -55
  130. data/lib/infinity_test/test_library/cucumber.rb +0 -22
  131. data/lib/infinity_test/test_library/rspec.rb +0 -60
  132. data/lib/infinity_test/test_library/test_unit.rb +0 -52
  133. data/lib/infinity_test/test_unit_loader.rb +0 -5
  134. data/spec/factories/buzz/lib/buzz.rb +0 -0
  135. data/spec/factories/buzz/spec/buzz_spec.rb +0 -0
  136. data/spec/factories/company/Gemfile +0 -0
  137. data/spec/factories/company/lib/company.rb +0 -0
  138. data/spec/factories/company/test/company_test.rb +0 -0
  139. data/spec/factories/images/failure.png +0 -0
  140. data/spec/factories/images/pending.png +0 -0
  141. data/spec/factories/images/sucess.png +0 -0
  142. data/spec/factories/infinity_test +0 -5
  143. data/spec/factories/infinity_test_example +0 -7
  144. data/spec/factories/slinky/spec/slinky/slinky_spec.rb +0 -0
  145. data/spec/factories/travel/lib/travel.rb +0 -0
  146. data/spec/factories/travel/test/partner_test.rb +0 -0
  147. data/spec/factories/travel/test/travel_test.rb +0 -0
  148. data/spec/factories/wood/lib/wood.rb +0 -0
  149. data/spec/factories/wood/spec/wood_spec.rb +0 -0
  150. data/spec/infinity_test/application_library/rails_spec.rb +0 -140
  151. data/spec/infinity_test/application_library/rubygems_spec.rb +0 -52
  152. data/spec/infinity_test/application_spec.rb +0 -434
  153. data/spec/infinity_test/binary_path_spec.rb +0 -72
  154. data/spec/infinity_test/command_spec.rb +0 -53
  155. data/spec/infinity_test/configuration_spec.rb +0 -382
  156. data/spec/infinity_test/continuous_testing_spec.rb +0 -25
  157. data/spec/infinity_test/environment_spec.rb +0 -23
  158. data/spec/infinity_test/heuristics_helper_spec.rb +0 -15
  159. data/spec/infinity_test/heuristics_spec.rb +0 -127
  160. data/spec/infinity_test/options_spec.rb +0 -111
  161. data/spec/infinity_test/runner_spec.rb +0 -42
  162. data/spec/infinity_test/test_framework_spec.rb +0 -127
  163. data/spec/infinity_test/test_library/bacon_spec.rb +0 -150
  164. data/spec/infinity_test/test_library/cucumber_spec.rb +0 -8
  165. data/spec/infinity_test/test_library/rspec_spec.rb +0 -189
  166. data/spec/infinity_test/test_library/test_unit_spec.rb +0 -184
  167. data/spec/infinity_test_spec.rb +0 -40
  168. /data/images/faces/{sucess.png → success.png} +0 -0
  169. /data/images/hands/{sucess.png → success.png} +0 -0
  170. /data/images/mario_bros/{sucess.jpg → success.jpg} +0 -0
  171. /data/images/rails/{sucess.png → success.png} +0 -0
  172. /data/images/rubies/{sucess.png → success.png} +0 -0
  173. /data/images/simpson/{sucess.jpg → success.jpg} +0 -0
  174. /data/images/street_fighter/{sucess.jpg → success.jpg} +0 -0
  175. /data/images/toy_story/{sucess.png → success.png} +0 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a6911d2416f7e79b5629dda190203656dad3c90b8b10dae6e8abaf0103412082
4
+ data.tar.gz: 5434be704db02566f39a2f6272eb238f648956d6396eb95b3ad0da5f44ef6d10
5
+ SHA512:
6
+ metadata.gz: 3401363f1c87b54b3242a518f7ff70f9c9c401753e22be535a24ea59984f902cda041363777fe32b0b416b168d30b18be4ed76dbdd981d29d67aeab5f7268242
7
+ data.tar.gz: 46cb6773e7ddce619f210c120b2ab4b88085266af6da383b593d90a4b8bc3430d4baa3386012d35ef7280efeafd8eaf8c40e231ca518d0f66676021b2a2f1a37
@@ -0,0 +1,31 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master, main]
6
+ pull_request:
7
+ branches: [master, main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, macos-latest]
16
+ ruby: ['3.1', '3.2', '3.3']
17
+ include:
18
+ - os: ubuntu-latest
19
+ ruby: jruby
20
+
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+
24
+ - name: Set up Ruby ${{ matrix.ruby }}
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: ${{ matrix.ruby }}
28
+ bundler-cache: true
29
+
30
+ - name: Run tests
31
+ run: bundle exec rspec
data/.gitignore CHANGED
@@ -11,3 +11,6 @@ rerun.txt
11
11
  *.rbc
12
12
  *~
13
13
  bin/*.rbc
14
+ .infinity_test_file
15
+ .ruby-version
16
+ Gemfile.lock
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
1
  --color
2
- --autotest
3
- --require fuubar --format Fuubar
2
+ --tty
3
+ -f d
@@ -0,0 +1,203 @@
1
+ # AI Integration Ideas for Infinity Test
2
+
3
+ This document outlines ideas for integrating Infinity Test with AI tools and agents, making Ruby development more efficient and intelligent.
4
+
5
+ ## 1. Claude Code Integration
6
+
7
+ ### Direct Integration
8
+ Infinity Test can work seamlessly with [Claude Code](https://claude.ai/claude-code), Anthropic's CLI tool for AI-assisted development.
9
+
10
+ **How it works:**
11
+ - Run `infinity_test` in one terminal while using Claude Code in another
12
+ - When Claude Code makes changes to your Ruby files, Infinity Test automatically runs the relevant tests
13
+ - Immediate feedback loop: write code → tests run → see results → iterate
14
+
15
+ **Example workflow:**
16
+ ```bash
17
+ # Terminal 1: Start infinity_test
18
+ infinity_test --mode rails
19
+
20
+ # Terminal 2: Use Claude Code
21
+ claude "Add a validation to the User model that requires email to be present"
22
+ # Infinity Test automatically runs user_spec.rb when user.rb changes
23
+ ```
24
+
25
+ ### AI-Powered Test Generation
26
+ Claude Code can generate tests based on your code changes:
27
+ ```bash
28
+ claude "Write RSpec tests for the new validation I just added to User model"
29
+ # Tests are created, infinity_test runs them automatically
30
+ ```
31
+
32
+ ## 2. MCP (Model Context Protocol) Server
33
+
34
+ Create an MCP server that exposes Infinity Test functionality to AI agents:
35
+
36
+ ```ruby
37
+ # Example MCP server endpoints
38
+ class InfinityTestMCPServer
39
+ # Get current test status
40
+ def get_test_status
41
+ { last_run: Time.now, failures: 0, pending: 2 }
42
+ end
43
+
44
+ # Run specific tests
45
+ def run_tests(files:)
46
+ InfinityTest.run(files)
47
+ end
48
+
49
+ # Get failed tests
50
+ def get_failures
51
+ # Return list of failed test files with error messages
52
+ end
53
+ end
54
+ ```
55
+
56
+ **Benefits:**
57
+ - AI agents can query test results programmatically
58
+ - Agents can trigger test runs for specific files
59
+ - Agents can understand test failures and suggest fixes
60
+
61
+ ## 3. AI-Assisted Debugging
62
+
63
+ ### Failure Analysis
64
+ When tests fail, integrate with AI to:
65
+ - Analyze the failure message
66
+ - Suggest potential fixes
67
+ - Identify related code that might need changes
68
+
69
+ ```ruby
70
+ # INFINITY_TEST configuration
71
+ InfinityTest.setup do |config|
72
+ config.after(:all) do |results|
73
+ if results.failures.any?
74
+ # Send failures to AI for analysis
75
+ AIHelper.analyze_failures(results.failures)
76
+ end
77
+ end
78
+ end
79
+ ```
80
+
81
+ ### Smart Test Selection
82
+ Use AI to predict which tests are most likely to fail based on:
83
+ - Which files were changed
84
+ - Historical failure patterns
85
+ - Code complexity metrics
86
+
87
+ ## 4. Natural Language Test Commands
88
+
89
+ Future idea: Integrate with AI to support natural language commands:
90
+
91
+ This is just an idea:
92
+
93
+ ```bash
94
+ # Instead of
95
+ infinity_test --focus spec/models/user_spec.rb
96
+
97
+ # Support natural language
98
+ infinity_test --ai "run tests for user authentication"
99
+ infinity_test --ai "only run the tests that failed yesterday"
100
+ infinity_test --ai "run slow tests in parallel"
101
+ ```
102
+
103
+ ## 5. Continuous Learning
104
+
105
+ ### Pattern Recognition
106
+ - Track which code changes tend to break which tests
107
+ - Learn from your project's test patterns
108
+ - Predict test failures before running
109
+
110
+ ### Smart Prioritization
111
+ - Run tests most likely to fail first
112
+ - Skip tests unlikely to be affected by changes
113
+ - Optimize test order for fastest feedback
114
+
115
+ ## 6. Integration with Popular AI Tools
116
+
117
+ ### GitHub Copilot
118
+ - Infinity Test watches files, Copilot suggests code
119
+ - Immediate test feedback on Copilot suggestions
120
+
121
+ ### Cursor IDE
122
+ - Real-time test results in Cursor's AI panel
123
+ - AI can see test output when suggesting fixes
124
+
125
+ ### Cody (Sourcegraph)
126
+ - Cody understands your test patterns
127
+ - Suggests tests based on code context
128
+
129
+ ## 7. Hooks for AI Agents
130
+
131
+ Add hooks that AI agents can use:
132
+
133
+ ```ruby
134
+ InfinityTest.setup do |config|
135
+ # Hook for AI to process before each test run
136
+ config.before(:all) do
137
+ AIAgent.notify(:test_starting)
138
+ end
139
+
140
+ # Hook for AI to process test results
141
+ config.after(:all) do |results|
142
+ AIAgent.process_results(results)
143
+ end
144
+
145
+ # Custom AI-powered heuristics
146
+ config.ai_heuristics do |changed_file|
147
+ AIAgent.predict_tests_to_run(changed_file)
148
+ end
149
+ end
150
+ ```
151
+
152
+ ## 8. Test Quality Analysis
153
+
154
+ Use AI to analyze test quality:
155
+ - Identify flaky tests
156
+ - Suggest missing test cases
157
+ - Detect duplicate tests
158
+ - Recommend test refactoring
159
+
160
+ ## 9. Documentation Generation
161
+
162
+ After tests pass, AI can:
163
+ - Generate documentation from test descriptions
164
+ - Update README with usage examples from tests
165
+ - Create API documentation from request specs
166
+
167
+ ## 10. Future Vision: Autonomous Testing
168
+
169
+ The ultimate goal - AI agents that:
170
+ 1. Watch you code
171
+ 2. Understand your intent
172
+ 3. Write appropriate tests
173
+ 4. Run those tests via Infinity Test
174
+ 5. Suggest improvements based on results
175
+ 6. Iterate until code is solid
176
+
177
+ ---
178
+
179
+ ## Getting Started
180
+
181
+ To integrate Infinity Test with Claude Code today:
182
+
183
+ 1. Install both tools:
184
+ ```bash
185
+ gem install infinity_test
186
+ npm install -g @anthropic/claude-code
187
+ ```
188
+
189
+ 2. Start Infinity Test in watch mode:
190
+ ```bash
191
+ infinity_test
192
+ ```
193
+
194
+ 3. Use Claude Code in another terminal:
195
+ ```bash
196
+ claude "Help me write a new feature for my Rails app"
197
+ ```
198
+
199
+ 4. Watch the magic happen!
200
+
201
+ ---
202
+
203
+ *This document is part of the Infinity Test project. Contributions and ideas welcome!*
data/Gemfile CHANGED
@@ -1,17 +1,5 @@
1
- #!/usr/bin/env ruby
1
+ source 'https://rubygems.org'
2
2
 
3
- source :rubygems
3
+ gem 'notifiers', github: 'tomas-stefano/notifiers', branch: 'main'
4
4
 
5
- gem 'watchr', '0.7'
6
- gem 'notifiers', '1.1.0'
7
-
8
- group :test do
9
- gem 'rspec', ">= 2.1.0"
10
- gem 'cucumber', '0.9.0'
11
- gem 'aruba', '0.2.1'
12
- gem 'fuubar'
13
- end
14
-
15
- group :development do
16
- gem 'jeweler'
17
- end
5
+ gemspec
data/HISTORY.md ADDED
@@ -0,0 +1,84 @@
1
+ # History
2
+
3
+ ## 2.0.0
4
+
5
+ ### New Features
6
+
7
+ - **Elixir Support**: Added ExUnit test framework, ElixirMix and Phoenix frameworks, and ElixirDefault strategy
8
+ - Auto-discovers Elixir projects by detecting `mix.exs`
9
+ - Phoenix framework: detects `lib/*_web` directory, watches all lib subdirectories
10
+ - ElixirMix framework: for standard Mix projects
11
+ - Watches `lib/**/*.ex` and `test/**/*.exs` files
12
+ - Parses ExUnit output (tests, failures, skipped)
13
+
14
+ - **Python Support**: Added Pytest test framework, PythonPackage framework, and PythonDefault strategy
15
+ - Auto-discovers Python projects by detecting `pyproject.toml`, `setup.py`, or `setup.cfg`
16
+ - Watches `src/`, `lib/`, and package directories with `__init__.py`
17
+ - Watches `tests/` or `test/` directories for test files
18
+ - Parses Pytest output (passed, failed, skipped)
19
+
20
+ - **Django Framework**: Full support for Django projects
21
+ - Auto-discovers Django projects by detecting `manage.py` with Django imports
22
+ - Watches Django app directories (models.py, views.py, apps.py)
23
+ - Maps app files to their corresponding tests
24
+
25
+ - **FastAPI Framework**: Support for FastAPI/ML API projects
26
+ - Auto-discovers FastAPI projects by detecting FastAPI imports in main.py
27
+ - Watches `app/`, `src/`, `routers/`, `api/`, `endpoints/` directories
28
+ - Perfect for ML model serving APIs
29
+
30
+ - **Rust Support**: Added CargoTest test framework, RustCargo and Rocket frameworks, and RustDefault strategy
31
+ - Auto-discovers Rust projects by detecting `Cargo.toml`
32
+ - Rocket framework: detects `rocket` dependency in Cargo.toml
33
+ - Watches `src/*.rs` files and runs tests matching module names
34
+ - Watches `tests/*.rs` for integration tests
35
+ - Parses cargo test output (passed, failed, ignored)
36
+
37
+ - **Modern Observers**: Replaced watchr with listen and filewatcher observers
38
+ - `listen` (default): Event-driven, uses native OS notifications
39
+ - `filewatcher`: Polling-based, works in VMs/NFS environments
40
+
41
+ - **RVM and RbEnv Strategies**: Multi-version Ruby testing support
42
+ - Run tests against multiple Ruby versions simultaneously
43
+ - Gemset support for RVM
44
+
45
+ - **Callbacks System**: Before/after hooks for test runs
46
+ - `before(:all)`, `after(:all)` for all test runs
47
+ - `before(:each_ruby)`, `after(:each_ruby)` for each Ruby version
48
+
49
+ - **Focus Mode**: Run specific tests with `--focus` option
50
+ - `--focus=:failures` to run only previously failed tests
51
+ - `--focus=path/to/file` to run specific test file
52
+
53
+ - **Just Watch Mode**: `--just-watch` option to skip initial test run
54
+
55
+ - **Auto-discover App Directories**: Automatically detect and watch Rails/Padrino app subdirectories (models, controllers, components, etc.)
56
+
57
+ - **Start Banner**: Display configuration summary on startup
58
+
59
+ - **Bundler Support**: Automatic `bundle exec` wrapping when Gemfile is present
60
+
61
+ - **Colored Output**: Preserve terminal colors with PTY and verbose command display
62
+
63
+ - **CLI Options**: Added `--notifications` and `--mode` options for desktop notifications
64
+
65
+ ### Improvements
66
+
67
+ - **Modern Notifications**: Updated to use modern notifiers gem with support for:
68
+ - macOS: terminal-notifier, osascript
69
+ - Linux: notify-send, dunstify
70
+
71
+ - **Priority Ordering**: Auto-discover now respects priority order for strategies, frameworks, and test frameworks
72
+
73
+ - **Rails and Padrino Heuristics**: Improved file watching patterns for Rails and Padrino applications
74
+
75
+ - **GitHub Actions**: Replaced Travis CI with GitHub Actions for CI/CD
76
+
77
+ - **Configuration File**: Renamed config file to `INFINITY_TEST`
78
+
79
+ ### Compatibility
80
+
81
+ - Updated for Ruby 3.x compatibility
82
+ - Updated for ActiveSupport 7.0+ compatibility
83
+ - Updated for modern RSpec syntax (replaced deprecated `stub` with `allow().to receive()`)
84
+ - Improved test descriptions by removing 'should' prefix
data/History.markdown CHANGED
@@ -1,4 +1,86 @@
1
+ v2.0.0
2
+ ======
3
+
4
+ This is a major release with a complete rewrite of the library, modernization of dependencies, and many new features.
5
+
6
+ Breaking Changes
7
+ ----------------
8
+ - Configuration file renamed from `.infinity_test` to `INFINITY_TEST`
9
+ - Removed Bacon test framework support
10
+ - Removed Growl notification support (use notifiers gem instead)
11
+ - The #before_env method in the configuration file was removed
12
+ - The #before_run and #after_run methods were removed. Use before(:all) and after(:all) instead
13
+
14
+ New Features
15
+ ------------
16
+ - **Modern Notifications**: Integration with the notifiers gem supporting:
17
+ - osascript (macOS built-in)
18
+ - terminal_notifier (macOS)
19
+ - notify_send (Linux libnotify)
20
+ - dunstify (Linux dunst)
21
+ - auto_discover (automatic detection)
22
+ - New CLI options: `--notifications` and `--mode` for image themes
23
+
24
+ - **Callbacks System**: Full callback support with before/after hooks
25
+ - `before(:all)` - Run before all tests
26
+ - `after(:all)` - Run after all tests
27
+ - `before(:each_ruby)` - Run before each Ruby version
28
+ - `after(:each_ruby)` - Run after each Ruby version
29
+
30
+ - **Multi-Ruby Support**:
31
+ - RVM strategy: Run tests across multiple Ruby versions with gemset support
32
+ - RbEnv strategy: Run tests with RBENV_VERSION environment variable
33
+ - RubyDefault strategy: Run on current Ruby version
34
+
35
+ - **Just Watch Mode**: `--just-watch` (-j) option to skip initial test run
36
+ - Useful for large applications where startup is slow
37
+ - Only watches for file changes and runs tests on change
38
+
39
+ - **Focus Mode**: `--focus` (-f) option for running specific tests
40
+ - `--focus failures` - Run only previously failed tests
41
+ - `--focus path/to/spec.rb` - Run only specified file
42
+
43
+ - **Framework Heuristics**:
44
+ - Rails: Watches models, controllers, helpers, mailers, jobs, lib
45
+ - Padrino: Similar to Rails with Padrino-specific paths
46
+ - Rubygems: Watches lib and test/spec directories
47
+
48
+ - **Auto Discovery Priority**: Smart prioritization when auto-discovering
49
+ - Strategies: RVM > RbEnv > RubyDefault
50
+ - Frameworks: Rails > Padrino > Rubygems
51
+ - Test Frameworks: RSpec > Test::Unit
52
+
53
+ - **Test Framework Improvements**:
54
+ - Complete Test::Unit/Minitest implementation with output parsing
55
+ - RSpec improvements: test_dir=, pending?, and .run? methods
56
+
57
+ - **Modern File Watching**:
58
+ - Listen gem (default) - Event-driven, uses native OS notifications
59
+ - Filewatcher gem - Polling-based, works everywhere including VMs/NFS
60
+
61
+ - **AI Integration Ideas**: Documentation for integrating with Claude Code and other AI tools
62
+
63
+ Bug Fixes
64
+ ---------
65
+ - Fixed signal handler blocking issue in observer base
66
+ - Fixed ActiveSupport autoload issues
67
+ - Replaced deprecated stub with allow().to receive() in specs
68
+
69
+ Dependencies
70
+ ------------
71
+ - Replaced watchr with listen and filewatcher observers
72
+ - Updated to modern notifiers gem (from GitHub main branch)
73
+ - Removed growl dependency
74
+
75
+ Internal Changes
76
+ ----------------
77
+ - Rewrite of the entire library with separated responsibilities
78
+ - Shared examples for creating custom strategies, frameworks, and observers
79
+ - Updated all specs to modern RSpec syntax
80
+ - Comprehensive test coverage (250+ examples)
81
+
1
82
  v1.0.1
83
+ ======
2
84
 
3
85
  - Fix a serious bug for Test::unit users (just run one test file instead of all tests)
4
86
 
@@ -1,8 +1,11 @@
1
- #!/usr/bin/env ruby
1
+ #InfinityTest.setup do |config|
2
+ # config.strategy = :ruby_default
3
+ # config.test_framework = :rspec
4
+ #end
2
5
 
3
- infinity_test do
4
-
5
- use :rubies => ['1.8.7', '1.9.2', 'jruby', 'ree', 'rbx'], :gemset => 'infinity_test', :test_framework => :rspec
6
+ # infinity_test do
7
+
8
+ # use :rubies => ['1.9.2', 'jruby', 'ree', 'rbx'], :gemset => 'infinity_test', :test_framework => :rspec
6
9
 
7
10
  # Maybe with block is better ...
8
11
  #
@@ -13,15 +16,15 @@ infinity_test do
13
16
  # application_framework = :rails
14
17
  # end
15
18
 
16
- heuristics do
17
- add '^lib/infinity_test/dependencies.rb' do |file|
18
- run :all => :files
19
- end
20
- end
21
-
22
- after(:all) do
23
- system('rake clean_without_verbose')
24
- end
19
+ # heuristics do
20
+ # add '^lib/infinity_test/dependencies.rb' do |file|
21
+ # run :all => :files
22
+ # end
23
+ # end
24
+
25
+ # after(:all) do
26
+ # system('rake clean_without_verbose')
27
+ # end
25
28
 
26
29
  # heuristics do
27
30
  #
@@ -36,10 +39,10 @@ infinity_test do
36
39
  # application_library.watch :dir => 'app/models' do |file|
37
40
  # run :test => "spec/models/"
38
41
  # end
39
- #
42
+ #
40
43
  # watch(%r%^(test|spec)/fixtures/(.*).yml$%) do |m|
41
44
  # "test/test_#{m[1]}.rb"
42
45
  # end
43
46
  # end
44
47
 
45
- end
48
+ # end
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2010 Tomás D'Stefano
3
+ Copyright (c) 2010-2014 Tomás D'Stefano
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
19
  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
20
  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
21
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.