/IronPython_Main/Languages/Ruby/Tests/Interop/cli/config_spec.rb

# · Ruby · 25 lines · 21 code · 4 blank · 0 comment · 4 complexity · e16b86686ac137152b7864dbbd49c913 MD5 · raw file

  1. require File.dirname(__FILE__) + '/../spec_helper'
  2. describe "ir.exe without ir.exe.config" do
  3. before(:all) do
  4. bin = ENV['DLR_BIN'] || File.join(ENV['DLR_ROOT'], "bin", "debug")
  5. temp_bin = tmp("bin")
  6. Dir.foreach(bin) do |file|
  7. FileUtils.cp(File.join(bin, file), temp_bin) if file =~ /^(IronRuby|ir|Microsoft)/
  8. end
  9. FileUtils.rm_f(File.join(temp_bin, "ir.exe.config"))
  10. @old_ruby_exe, ENV['RUBY_EXE'] = ENV['RUBY_EXE'], File.join(temp_bin, "ir.exe")
  11. end
  12. after(:all) do
  13. ENV['RUBY_EXE'] = @old_ruby_exe
  14. end
  15. it "still runs" do
  16. ruby_exe("puts 'Hello'").chomp.should == "Hello"
  17. end
  18. it "can still host IR.exe" do
  19. ruby_exe(fixture(__FILE__, "hosting.rb")).chomp.should == "2"
  20. end
  21. end