Sha256: 91a40f84b01d68d1f99815d53918bf23f7788ee915e609a94b8740a3a3793062

Contents?: true

Size: 1.01 KB

Versions: 56

Compression:

Stored size: 1.01 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

56 entries across 53 versions & 6 rubygems

Version Path
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.1.0 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.13 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.12.1 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.11 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.9 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.8 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.7 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.6 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.5 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.4 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.2 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
tdiary-5.0.1 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/launchy-2.4.3/spec/detect/ruby_engine_spec.rb