Commit Graph

1 Commits

Author SHA1 Message Date
0611a2aa82 Add smoke tests for opencode-rails
14 tests across 4 files covering the gem's public surface:

  test/opencode/loading_test.rb (5 tests)
    - All 12 gem-provided constants resolve after require
    - Transitively-loaded opencode-ruby constants are present
    - Opencode::Session source_location points at this gem
    - Opencode::Client source_location points at opencode-ruby
    - Opencode::Rails::VERSION matches semver

  test/opencode/error_reporter_test.rb (3 tests)
    - report is no-op without adapter (returns nil)
    - report forwards error + opts to adapter
    - report works with no kwargs

  test/opencode/exchange_test.rb (3 tests)
    - Initializes with empty / nil / Array(coerced) messages
    - tool_artifacts(exclude:) doesn't raise on empty input

  test/opencode/artifact_test.rb (3 tests)
    - Filename/content/content_type/metadata readers
    - metadata defaults to {} when omitted
    - Trust metadata round-trips

Behavioral tests for Session/Turn/MessageArtifacts (AR + ActiveStorage
fixtures) stay in the host application (ajent-rails) where the
integration environment exists. Same pattern as opencode-ruby:
  - gem smoke tests prove load-time correctness
  - host tests prove integration correctness
2026-05-20 05:15:49 -07:00