Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
39a5a17
Fix ActiveSupport::Autoload error for ActiveSupport 7.0+
tomas-stefano Feb 1, 2026
a76a3e9
Update specs and code for modern Ruby/RSpec/ActiveSupport compatibility
tomas-stefano Feb 1, 2026
8dccc27
Updating to the latest versions
tomas-stefano Feb 1, 2026
d0e3030
Improve test descriptions by removing 'should' prefix
tomas-stefano Feb 1, 2026
91fd876
Replace deprecated stub with allow().to receive() syntax
tomas-stefano Feb 1, 2026
38d5792
Replace watchr with listen and filewatcher observers
tomas-stefano Feb 1, 2026
bf4a3cf
Fix signal handler blocking issue in observer base
tomas-stefano Feb 1, 2026
806061a
Update notifications to use modern notifiers gem
tomas-stefano Feb 1, 2026
7e153dc
Use notifiers gem from GitHub main branch
tomas-stefano Feb 1, 2026
33d2bac
Add --notifications and --mode CLI options for notifiers gem
tomas-stefano Feb 1, 2026
e314303
Remove unecessary code
tomas-stefano Feb 1, 2026
c863bf7
Rename config file to INFINITY_TEST and complete test frameworks
tomas-stefano Feb 1, 2026
daba99b
Implement RVM and RbEnv strategies for multi-version testing
tomas-stefano Feb 1, 2026
84bd7eb
Implement heuristics for Rails and Padrino frameworks
tomas-stefano Feb 1, 2026
d6203c2
Add priority ordering to auto discover feature
tomas-stefano Feb 1, 2026
9ec45af
Update TODO with completed items
tomas-stefano Feb 1, 2026
c7bf999
Implement callbacks system and --just-watch option
tomas-stefano Feb 1, 2026
44a864d
Add --focus option for running specific tests
tomas-stefano Feb 1, 2026
d03368c
Add AI integration ideas and update documentation
tomas-stefano Feb 1, 2026
2830905
Make ruby rvm and rbenv play nice with each other
tomas-stefano Feb 1, 2026
cf68e96
Update readme with the new version instructions
tomas-stefano Feb 2, 2026
2993863
Replace Travis CI with GitHub Actions
tomas-stefano Feb 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
ruby: ['3.1', '3.2', '3.3']
include:
- os: ubuntu-latest
ruby: jruby

steps:
- uses: actions/checkout@v4

- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Run tests
run: bundle exec rspec
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

203 changes: 203 additions & 0 deletions AI_INTEGRATION_IDEAS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
# AI Integration Ideas for Infinity Test

This document outlines ideas for integrating Infinity Test with AI tools and agents, making Ruby development more efficient and intelligent.

## 1. Claude Code Integration

### Direct Integration
Infinity Test can work seamlessly with [Claude Code](https://claude.ai/claude-code), Anthropic's CLI tool for AI-assisted development.

**How it works:**
- Run `infinity_test` in one terminal while using Claude Code in another
- When Claude Code makes changes to your Ruby files, Infinity Test automatically runs the relevant tests
- Immediate feedback loop: write code → tests run → see results → iterate

**Example workflow:**
```bash
# Terminal 1: Start infinity_test
infinity_test --mode rails

# Terminal 2: Use Claude Code
claude "Add a validation to the User model that requires email to be present"
# Infinity Test automatically runs user_spec.rb when user.rb changes
```

### AI-Powered Test Generation
Claude Code can generate tests based on your code changes:
```bash
claude "Write RSpec tests for the new validation I just added to User model"
# Tests are created, infinity_test runs them automatically
```

## 2. MCP (Model Context Protocol) Server

Create an MCP server that exposes Infinity Test functionality to AI agents:

```ruby
# Example MCP server endpoints
class InfinityTestMCPServer
# Get current test status
def get_test_status
{ last_run: Time.now, failures: 0, pending: 2 }
end

# Run specific tests
def run_tests(files:)
InfinityTest.run(files)
end

# Get failed tests
def get_failures
# Return list of failed test files with error messages
end
end
```

**Benefits:**
- AI agents can query test results programmatically
- Agents can trigger test runs for specific files
- Agents can understand test failures and suggest fixes

## 3. AI-Assisted Debugging

### Failure Analysis
When tests fail, integrate with AI to:
- Analyze the failure message
- Suggest potential fixes
- Identify related code that might need changes

```ruby
# INFINITY_TEST configuration
InfinityTest.setup do |config|
config.after(:all) do |results|
if results.failures.any?
# Send failures to AI for analysis
AIHelper.analyze_failures(results.failures)
end
end
end
```

### Smart Test Selection
Use AI to predict which tests are most likely to fail based on:
- Which files were changed
- Historical failure patterns
- Code complexity metrics

## 4. Natural Language Test Commands

Future idea: Integrate with AI to support natural language commands:

This is just an idea:

```bash
# Instead of
infinity_test --focus spec/models/user_spec.rb

# Support natural language
infinity_test --ai "run tests for user authentication"
infinity_test --ai "only run the tests that failed yesterday"
infinity_test --ai "run slow tests in parallel"
```

## 5. Continuous Learning

### Pattern Recognition
- Track which code changes tend to break which tests
- Learn from your project's test patterns
- Predict test failures before running

### Smart Prioritization
- Run tests most likely to fail first
- Skip tests unlikely to be affected by changes
- Optimize test order for fastest feedback

## 6. Integration with Popular AI Tools

### GitHub Copilot
- Infinity Test watches files, Copilot suggests code
- Immediate test feedback on Copilot suggestions

### Cursor IDE
- Real-time test results in Cursor's AI panel
- AI can see test output when suggesting fixes

### Cody (Sourcegraph)
- Cody understands your test patterns
- Suggests tests based on code context

## 7. Hooks for AI Agents

Add hooks that AI agents can use:

```ruby
InfinityTest.setup do |config|
# Hook for AI to process before each test run
config.before(:all) do
AIAgent.notify(:test_starting)
end

# Hook for AI to process test results
config.after(:all) do |results|
AIAgent.process_results(results)
end

# Custom AI-powered heuristics
config.ai_heuristics do |changed_file|
AIAgent.predict_tests_to_run(changed_file)
end
end
```

## 8. Test Quality Analysis

Use AI to analyze test quality:
- Identify flaky tests
- Suggest missing test cases
- Detect duplicate tests
- Recommend test refactoring

## 9. Documentation Generation

After tests pass, AI can:
- Generate documentation from test descriptions
- Update README with usage examples from tests
- Create API documentation from request specs

## 10. Future Vision: Autonomous Testing

The ultimate goal - AI agents that:
1. Watch you code
2. Understand your intent
3. Write appropriate tests
4. Run those tests via Infinity Test
5. Suggest improvements based on results
6. Iterate until code is solid

---

## Getting Started

To integrate Infinity Test with Claude Code today:

1. Install both tools:
```bash
gem install infinity_test
npm install -g @anthropic/claude-code
```

2. Start Infinity Test in watch mode:
```bash
infinity_test
```

3. Use Claude Code in another terminal:
```bash
claude "Help me write a new feature for my Rails app"
```

4. Watch the magic happen!

---

*This document is part of the Infinity Test project. Contributions and ideas welcome!*
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source 'https://rubygems.org'

gemspec
gem 'notifiers', github: 'tomas-stefano/notifiers', branch: 'main'

gemspec
94 changes: 80 additions & 14 deletions History.markdown
Original file line number Diff line number Diff line change
@@ -1,17 +1,83 @@
development
===========

- Rewrite the ENTIRE LIBRARY (Separate responsabilities!)
- The #before_env method in the configuration file was removed.
- The #before_run and #after_run method in the configuration file, was removed. Use before(:all) and after(:all) instead.
- Shared Examples to create your own strategy.
- Update all specs to RSpec 2.
- Now you can create your own observer (case you want add other gem like watchr / monitor files).
- Now you can add more patterns to monitor in a simple dsl without ugly nasty code.

- Work Notifications using the notifiers gem.
- Work RSpec with the new way of auto discover libraries.
- Work Rubygems. \o/
v2.0.0
======

This is a major release with a complete rewrite of the library, modernization of dependencies, and many new features.

Breaking Changes
----------------
- Configuration file renamed from `.infinity_test` to `INFINITY_TEST`
- Removed Bacon test framework support
- Removed Growl notification support (use notifiers gem instead)
- The #before_env method in the configuration file was removed
- The #before_run and #after_run methods were removed. Use before(:all) and after(:all) instead

New Features
------------
- **Modern Notifications**: Integration with the notifiers gem supporting:
- osascript (macOS built-in)
- terminal_notifier (macOS)
- notify_send (Linux libnotify)
- dunstify (Linux dunst)
- auto_discover (automatic detection)
- New CLI options: `--notifications` and `--mode` for image themes

- **Callbacks System**: Full callback support with before/after hooks
- `before(:all)` - Run before all tests
- `after(:all)` - Run after all tests
- `before(:each_ruby)` - Run before each Ruby version
- `after(:each_ruby)` - Run after each Ruby version

- **Multi-Ruby Support**:
- RVM strategy: Run tests across multiple Ruby versions with gemset support
- RbEnv strategy: Run tests with RBENV_VERSION environment variable
- RubyDefault strategy: Run on current Ruby version

- **Just Watch Mode**: `--just-watch` (-j) option to skip initial test run
- Useful for large applications where startup is slow
- Only watches for file changes and runs tests on change

- **Focus Mode**: `--focus` (-f) option for running specific tests
- `--focus failures` - Run only previously failed tests
- `--focus path/to/spec.rb` - Run only specified file

- **Framework Heuristics**:
- Rails: Watches models, controllers, helpers, mailers, jobs, lib
- Padrino: Similar to Rails with Padrino-specific paths
- Rubygems: Watches lib and test/spec directories

- **Auto Discovery Priority**: Smart prioritization when auto-discovering
- Strategies: RVM > RbEnv > RubyDefault
- Frameworks: Rails > Padrino > Rubygems
- Test Frameworks: RSpec > Test::Unit

- **Test Framework Improvements**:
- Complete Test::Unit/Minitest implementation with output parsing
- RSpec improvements: test_dir=, pending?, and .run? methods

- **Modern File Watching**:
- Listen gem (default) - Event-driven, uses native OS notifications
- Filewatcher gem - Polling-based, works everywhere including VMs/NFS

- **AI Integration Ideas**: Documentation for integrating with Claude Code and other AI tools

Bug Fixes
---------
- Fixed signal handler blocking issue in observer base
- Fixed ActiveSupport autoload issues
- Replaced deprecated stub with allow().to receive() in specs

Dependencies
------------
- Replaced watchr with listen and filewatcher observers
- Updated to modern notifiers gem (from GitHub main branch)
- Removed growl dependency

Internal Changes
----------------
- Rewrite of the entire library with separated responsibilities
- Shared examples for creating custom strategies, frameworks, and observers
- Updated all specs to modern RSpec syntax
- Comprehensive test coverage (250+ examples)

v1.0.1
======
Expand Down
11 changes: 5 additions & 6 deletions .infinity_test → INFINITY_TEST
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
InfinityTest.setup do |config|
config.strategy = :ruby_default
config.test_framework = :rspec
config.notifications = :growl
end
#InfinityTest.setup do |config|
# config.strategy = :ruby_default
# config.test_framework = :rspec
#end

# infinity_test do

Expand Down Expand Up @@ -46,4 +45,4 @@ end
# end
# end

# end
# end
Loading