Enable RuboCop Minitest and RuboCop Rake for development
Based on the following information, `rubocop-minitest` and `rubocop-rake` have been added for development. Autocorrection has been applied for offenses detected by `rubocop-minitest`. ```console $ bundle exec rake (snip) Running RuboCop... Inspecting 40 files ........................................ 40 files inspected, no offenses detected Tip: Based on detected gems, the following RuboCop extension libraries might be helpful: * rubocop-minitest (https://rubygems.org/gems/rubocop-minitest) * rubocop-rake (https://rubygems.org/gems/rubocop-rake) You can opt out of this message by adding the following to your config (see https://docs.rubocop.org/rubocop/extensions.html#extension-suggestions for more options): AllCops: SuggestExtensions: false ``` If preserving the existing behavior is preferred, it is also possible to set `SuggestExtensions: false`.
This commit is contained in:
parent
6b49222edb
commit
a169bbd2ba
6 changed files with 11 additions and 4 deletions
|
|
@ -1,5 +1,10 @@
|
|||
inherit_gem:
|
||||
rubocop-shopify: rubocop.yml
|
||||
|
||||
plugins:
|
||||
- rubocop-minitest
|
||||
- rubocop-rake
|
||||
|
||||
Naming/FileName:
|
||||
Exclude:
|
||||
- 'lib/mcp-ruby.rb'
|
||||
|
|
|
|||
2
Gemfile
2
Gemfile
|
|
@ -8,6 +8,8 @@ gemspec
|
|||
# Specify development dependencies below
|
||||
gem "minitest", "~> 5.1", require: false
|
||||
gem "rake", "~> 13.0"
|
||||
gem "rubocop-minitest"
|
||||
gem "rubocop-rake"
|
||||
gem "rubocop-shopify", require: false
|
||||
|
||||
gem "minitest-reporters"
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ module ModelContextProtocol
|
|||
assert_equal "a mock prompt for testing", prompt.description
|
||||
assert_equal "test_argument", prompt.arguments.first.name
|
||||
assert_equal "Test argument", prompt.arguments.first.description
|
||||
assert_equal true, prompt.arguments.first.required
|
||||
assert prompt.arguments.first.required
|
||||
|
||||
expected_template_result = {
|
||||
description: "Hello, world!",
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ module ModelContextProtocol
|
|||
assert_kind_of Array, result[:tools]
|
||||
assert_equal "test_tool", result[:tools][0][:name]
|
||||
assert_equal "Test tool", result[:tools][0][:description]
|
||||
assert_equal({}, result[:tools][0][:inputSchema])
|
||||
assert_empty(result[:tools][0][:inputSchema])
|
||||
assert_instrumentation_data({ method: "tools/list" })
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ module ModelContextProtocol
|
|||
|
||||
test "missing_required_arguments returns an empty array if no required arguments are missing" do
|
||||
input_schema = InputSchema.new(properties: { message: { type: "string" } }, required: [:message])
|
||||
assert_equal [], input_schema.missing_required_arguments({ message: "Hello, world!" })
|
||||
assert_empty input_schema.missing_required_arguments({ message: "Hello, world!" })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ module ModelContextProtocol
|
|||
response = JSON.parse(output.string, symbolize_names: true)
|
||||
assert_equal("2.0", response[:jsonrpc])
|
||||
assert_equal("123", response[:id])
|
||||
assert_equal({}, response[:result])
|
||||
assert_empty(response[:result])
|
||||
refute(@transport.instance_variable_get(:@open))
|
||||
ensure
|
||||
$stdin = original_stdin
|
||||
|
|
|
|||
Loading…
Reference in a new issue