You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: test_gem_commands_contents_command.rb
    path of file: ./repos/truffleruby/test/mri/tests/rubygems
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
require_relative "helper"
require "rubygems/commands/contents_command"

class TestGemCommandsCon
    
  def test_execute_missing_version
    @cmd.options[:args] = %w[foo]
    @cmd.options[:version] = Gem::Requirement.new "= 2"

    gem "foo", 1

    assert_raise Gem::MockGemUi::TermError do
      use_ui @ui do
        @cmd.execute
      end
    end

    assert_match "Unable to find gem 'foo'", @ui.output
    assert_empty @ui.error
  end