mirror of
https://github.com/kbwo/testing-language-server.git
synced 2025-07-24 11:23:42 +00:00
feat: Add RSpec test adapter and perform project cleanup
This commit introduces a new test adapter for the RSpec testing framework and includes general code cleanup. RSpec Adapter Features: - Implements the `Runner` trait for RSpec. - Uses `tree-sitter-ruby` for test discovery from `*_spec.rb` files, identifying `describe`, `context`, and `it` blocks. - Executes RSpec tests using the `rspec -f json` command and parses the JSON output to generate diagnostics for failed tests. - Detects RSpec workspaces by looking for `Gemfile` or `.rspec` files. - Includes a demo RSpec project (`demo/rspec_project`) for testing. - Adds integration tests (`crates/adapter/tests/rspec_test.rs`) covering workspace detection, test discovery, and diagnostic parsing. Cleanup and Fixes: - I refactored the RSpec adapter to be fully synchronous, resolving previous compilation issues with the `Runner` trait. - I removed unused imports and dead code in the RSpec adapter files. - I ensured the `crates/adapter/src/runner/phpunit.rs` uses the correct tree-sitter PHP language function, confirming a previous fix. - I verified that the entire project builds successfully using `cargo build --all-targets`. - I confirmed all RSpec-specific tests pass. Pre-existing test failures in Jest, Node, and Vitest adapters remain and are noted as out of scope for this change. The implementation adheres to the synchronous nature of the `Runner` trait, ensuring correct integration with the existing adapter framework.
This commit is contained in:
parent
c53cdb6a6b
commit
ca66d265d1
14 changed files with 571 additions and 27 deletions
22
demo/rspec_project/spec/example_spec.rb
Normal file
22
demo/rspec_project/spec/example_spec.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
# spec/example_spec.rb
|
||||
describe "MyString" do
|
||||
context "concatenation" do
|
||||
it "should concatenate two strings" do
|
||||
str1 = "Hello"
|
||||
str2 = "World"
|
||||
expect(str1 + " " + str2).to eq("Hello World")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "Math" do
|
||||
it "should add two numbers correctly" do
|
||||
expect(1 + 1).to eq(2)
|
||||
end
|
||||
|
||||
it "should fail a test" do
|
||||
expect(1 + 1).to eq(3) # This will fail
|
||||
end
|
||||
|
||||
it "is a pending test" # This is a pending test
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue