File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed
Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 88
99ENV [ "RAILS_ENV" ] = "test"
1010
11+ # Default to rails8.gemfile for local development.
12+ # CI overrides this via BUNDLE_GEMFILE env var to test against multiple Rails versions.
13+ # See gemfiles/ directory and .github/workflows/ci.yml for available configurations.
14+ ENV [ "BUNDLE_GEMFILE" ] ||= File . expand_path ( "../gemfiles/rails8.gemfile" , __dir__ )
1115require "bundler/setup"
1216
1317$LOAD_PATH. unshift File . expand_path ( "../test" , __dir__ )
Original file line number Diff line number Diff line change @@ -30,6 +30,49 @@ To document a new feature:
30303 . Import test regions into documentation
31314 . Preview locally with ` bin/docs `
3232
33+ ## Running Tests
34+
35+ ### Prerequisites
36+
37+ Install dependencies:
38+
39+ ``` bash
40+ bundle install
41+ ```
42+
43+ ### Running the Test Suite
44+
45+ ``` bash
46+ bin/test
47+ ```
48+
49+ This uses ` gemfiles/rails8.gemfile ` by default. To test against other Rails versions:
50+
51+ ``` bash
52+ BUNDLE_GEMFILE=gemfiles/rails7.gemfile bundle install
53+ BUNDLE_GEMFILE=gemfiles/rails7.gemfile bin/test
54+ ```
55+
56+ See ` gemfiles/ ` for available configurations.
57+
58+ ### API Keys
59+
60+ Most tests use VCR cassettes (recorded HTTP responses), so they run without API credentials. You only need API keys when:
61+
62+ - Re-recording VCR cassettes
63+ - Running tests against live APIs
64+ - Adding tests for new API interactions
65+
66+ To set API keys, create ` .env.test ` in the project root:
67+
68+ ``` bash
69+ OPENAI_API_KEY=your_key_here
70+ ANTHROPIC_API_KEY=your_key_here
71+ OPEN_ROUTER_API_KEY=your_key_here
72+ ```
73+
74+ Or export them in your shell before running tests.
75+
3376## How It Works
3477
3578### VitePress Code Imports
You can’t perform that action at this time.
0 commit comments