Sha256: 6597e4c88664dbff3569ee90e363f5b1f1cc43b0deb432b6466601cbd704dba8

Contents?: true

Size: 925 Bytes

Versions: 3

Compression:

Stored size: 925 Bytes

Contents

begin
  require 'spec'
  require 'ffi'
rescue LoadError
  require 'rubygems' unless ENV['NO_RUBYGEMS']
  gem 'rspec'
  require 'spec'
  require 'ffi'
end

$:.unshift(File.dirname(__FILE__) + '/../lib')
require 'rupy'

module TestConstants
  #REDEFINE THESE SO THEY ARE VISIBILE
    AString = "STRING"
    AnInt = 1
    AChar = 'a'
    AFloat = 1.0
    AnArray = [AnInt, AChar, AFloat, AString]
    ASym = :sym
    AHash = {
      AnInt => AnInt,
      AChar.to_sym => AChar,
      ASym => AFloat,
      AString => AString
    }
    AConvertedHash = Hash[*AHash.map do |k, v|
      key = k.is_a?(Symbol)? k.to_s : k
      [key,v]
    end.flatten]
end

def run_python_command(cmd)
  IO.popen("python -c '#{cmd}'") { |f| f.gets.chomp}
end

class Rupy::RubyPyProxy
  [:should, :should_not, :class].each { |m| reveal(m) }
end

share_as :RubyPythonStartStop do
  before do
    Rupy.start
  end

  after do
    Rupy.stop
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rupy-0.4.2 spec/spec_helper.rb
rupy-0.4.1 spec/spec_helper.rb
rupy-0.4.0 ./spec/spec_helper.rb