File: ruby_engine_spec.rb

package info (click to toggle)
ruby-ruby-engine 2.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 112 kB
  • sloc: ruby: 57; makefile: 5
file content (25 lines) | stat: -rw-r--r-- 595 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require_relative 'spec_helper'

describe 'RubyEngine' do
  before :all do
    RubyEngine.instance_variable_set(:@interpreter, "jruby")
  end

  it 'should display RUBY_ENGINE if called directly (to_s)' do
    RubyEngine.to_s.should == 'jruby'
  end

  describe '.is?' do
    it 'returns true if current ruby engine matches' do
      RubyEngine.is?('jruby').should == true
    end

    it 'returns false if current ruby engine does not match' do
      RubyEngine.is?('maglev').should == false
    end

    it 'also supports regex' do
      RubyEngine.is?(/ruby/).should == true
    end
  end
end