Skip to content

Conversation

@santiagodiaz
Copy link
Contributor

@santiagodiaz santiagodiaz commented Oct 23, 2025

Add new spec files for Mars::Agent, Mars::Aggregator and Mars::Gate to improve test coverage.


Open in Cursor Open in Web

@cursor
Copy link

cursor bot commented Oct 23, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@santiagodiaz santiagodiaz marked this pull request as ready for review October 23, 2025 20:59
Comment on lines 20 to 28

RSpec/MultipleExpectations:
Enabled: false

RSpec/ExampleLength:
Enabled: false

RSpec/VerifiedDoubleReference:
Enabled: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSpec/VerifiedDoubleReference: Enabled: false
was added because of the instance_double line for skipping this rubocop offense:

spec/mars/agent_spec.rb:7:23: C: [Correctable] RSpec/VerifiedDoubleReference: Use a constant class reference for verified doubles. String references are not verifying unless the class is loaded.
    instance_double("RubyLLM::Chat").tap do |mock|

I think it depends if we want to keep that test that is mocking the rubyllm chat in agent_spec.rb

Comment on lines 60 to 67
allow(agent).to receive(:chat).and_return(mock_chat)
allow(mock_chat).to receive(:ask).with("test input").and_return("response")

result = agent.run("test input")

expect(result).to eq("response")
expect(mock_chat).to have_received(:ask).with("test input")
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything is so mocked that I'm not sure these tests add value at all

Copy link
Member

@santib santib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using AI for tests it usually generates all this. It happened to me but I trimmed it to just the tests that add value, check https://github.com/rootstrap/mars/blob/main/spec/mars/workflows/sequential_spec.rb and https://github.com/rootstrap/mars/blob/main/spec/mars/runnable_spec.rb as examples

@santiagodiaz santiagodiaz force-pushed the cursor/add-spec-files-for-mars-components-fee2 branch from ba6eb49 to 8ceb7cd Compare October 30, 2025 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants