Sha256: 5e474f3c9d88cee0e03bc5c8e711aecd36375b8fcf3bc502cca040ce2fe7e11b

Contents?: true

Size: 1.13 KB

Versions: 16

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'
require 'aruba/api'

describe "Aruba JRuby Startup Helper"  do
  before(:all) do
    @fake_env = ENV.clone
  end

  before :each do
    Aruba.config.reset

    # Define before_cmd-hook
    load 'aruba/config/jruby.rb'
  end

  before(:each) do
    @fake_env['JRUBY_OPTS'] = "--1.9"
    @fake_env['JAVA_OPTS'] = "-Xdebug"

    stub_const('ENV', @fake_env)
  end

  context 'when some mri ruby' do
    before :each do
      stub_const('RUBY_PLATFORM', 'x86_64-chocolate')
    end

    before :each do
      Aruba.config.before :command, self
    end

    it { expect(ENV['JRUBY_OPTS']).to eq '--1.9' }
    it { expect(ENV['JAVA_OPTS']).to eq '-Xdebug' }
  end

  context 'when jruby ruby' do
    before :each do
      stub_const('RUBY_PLATFORM', 'java')
    end

    before :each do
      rb_config = double('rb_config')
      allow(rb_config).to receive(:[]).and_return('solaris')

      stub_const 'RbConfig::CONFIG', rb_config
    end

    before :each do
      Aruba.config.before :command, self
    end

    it { expect(ENV['JRUBY_OPTS']).to eq '--dev -X-C --1.9' }
    it { expect(ENV['JAVA_OPTS']).to eq '-d32 -Xdebug' }
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
aruba-0.13.0 spec/aruba/jruby_spec.rb
aruba-0.12.0 spec/aruba/jruby_spec.rb
aruba-0.11.2 spec/aruba/jruby_spec.rb
aruba-0.11.1 spec/aruba/jruby_spec.rb
aruba-0.11.0.pre4 spec/aruba/jruby_spec.rb
aruba-0.11.0.pre3 spec/aruba/jruby_spec.rb
aruba-0.11.0.pre2 spec/aruba/jruby_spec.rb
aruba-0.11.0.pre spec/aruba/jruby_spec.rb
aruba-0.10.2 spec/aruba/jruby_spec.rb
aruba-0.10.1 spec/aruba/jruby_spec.rb
aruba-0.10.0 spec/aruba/jruby_spec.rb
aruba-0.10.0.pre2 spec/aruba/jruby_spec.rb
aruba-0.10.0.pre spec/aruba/jruby_spec.rb
aruba-0.9.0 spec/aruba/jruby_spec.rb
aruba-0.9.0.pre2 spec/aruba/jruby_spec.rb
aruba-0.9.0.pre spec/aruba/jruby_spec.rb