Warn when Roots, Sampling, or Logging APIs are used with MCP protocol version 2026-07-28 or newer. Add a shared protocol deprecation helper, YARD deprecation notes, and regression tests covering warnings at and after the deprecation threshold and no warnings for older or never-established protocol versions. Closes https://github.com/modelcontextprotocol/ruby-sdk/issues/390 Co-authored-by: Qlaw <noreply@qlaw.quick.shopify.io>
14 lines
547 B
Ruby
14 lines
547 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "test_helper"
|
|
|
|
module MCP
|
|
class ProtocolDeprecationsTest < ActiveSupport::TestCase
|
|
test "roots, sampling, and logging are deprecated in 2026-07-28 and later" do
|
|
refute ProtocolDeprecations.deprecated_roots_sampling_logging?(nil)
|
|
refute ProtocolDeprecations.deprecated_roots_sampling_logging?("2025-11-25")
|
|
assert ProtocolDeprecations.deprecated_roots_sampling_logging?("2026-07-28")
|
|
assert ProtocolDeprecations.deprecated_roots_sampling_logging?("2027-01-01")
|
|
end
|
|
end
|
|
end
|