Package org.asciidoctor.internal

Source Code of org.asciidoctor.internal.WhenEnvironmentVariablesAreSet

package org.asciidoctor.internal;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

import org.jruby.RubyString;
import org.jruby.runtime.builtin.IRubyObject;
import org.junit.Test;

public class WhenEnvironmentVariablesAreSet {

  @Test
  public void they_should_be_available_inside_ruby_engine() {
   
    JRubyAsciidoctor asciidoctor = (JRubyAsciidoctor) JRubyAsciidoctor.create("My_gem_path");
    IRubyObject evalScriptlet = asciidoctor.rubyRuntime.evalScriptlet("ENV['GEM_PATH']");
   
    RubyString gemPathValue = (RubyString)evalScriptlet;
    assertThat(gemPathValue.asJavaString(), is("My_gem_path"));
   
   
  }
 
}
TOP

Related Classes of org.asciidoctor.internal.WhenEnvironmentVariablesAreSet

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.