summaryrefslogtreecommitdiff
path: root/spec/ruby/command_line/dash_v_spec.rb
blob: d30efa37d68c231b27d4d33c0f14a58666f5768c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require_relative '../spec_helper'
require_relative 'shared/verbose'

describe "The -v command line option" do
  it_behaves_like :command_line_verbose, "-v"

  describe "when used alone" do
    it "prints version and ends" do
      ruby_exe(nil, args: '-v').sub("+PRISM ", "").should include(RUBY_DESCRIPTION.sub("+PRISM ", ""))
    end unless (defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?) ||
               (defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?) ||
               (ENV['RUBY_GC_LIBRARY'] && ENV['RUBY_GC_LIBRARY'].length > 0) ||
               (ENV['RUBY_MN_THREADS'] == '1')
  end
end