Sha256: a349b68ac6d6508d5f2c5b2b28cec331eb0491ad99db9e7683c662a922b3253c

Contents?: true

Size: 1.02 KB

Versions: 23

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'

describe Launchy::Detect::RubyEngine do

  before do
    Launchy.reset_global_options
  end

  after do
    Launchy.reset_global_options
  end

  %w[ ruby jruby rbx macruby ].each do |ruby|
    it "detects the #{ruby} RUBY_ENGINE" do
      _(Launchy::Detect::RubyEngine.detect( ruby ).ancestors).must_include Launchy::Detect::RubyEngine
    end
  end

  it "uses the global ruby_engine overrides" do
    ENV['LAUNCHY_RUBY_ENGINE'] = "rbx"
    _(Launchy::Detect::RubyEngine.detect).must_equal Launchy::Detect::RubyEngine::Rbx
    ENV.delete('LAUNCHY_RUBY_ENGINE')
  end

  it "does not find a ruby engine of 'foo'" do
    _(lambda { Launchy::Detect::RubyEngine.detect( 'foo' ) }).must_raise Launchy::Detect::RubyEngine::NotFoundError
  end

  { 'rbx'     => :rbx?,
    'ruby'    => :mri?,
    'macruby' => :macruby?,
    'jruby'   => :jruby? }.each_pair do |engine, method|
    it "#{method} returns true for #{engine} " do
      _(Launchy::Detect::RubyEngine.detect( engine ).send( method )).must_equal true
    end
 end
end

Version data entries

23 entries across 14 versions & 2 rubygems

Version Path
launchy-2.5.2 spec/detect/ruby_engine_spec.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.1.4 vendor/bundle/ruby/2.7.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.1.3 vendor/bundle/ruby/2.6.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb
tdiary-5.1.3 vendor/bundle/ruby/2.7.0/gems/launchy-2.5.0/spec/detect/ruby_engine_spec.rb