Sha256: 6cc16867a9f64250becb0cae6efb155ab968f342e93597b1fccf46bc6a849a3a

Contents?: true

Size: 598 Bytes

Versions: 2

Compression:

Stored size: 598 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper.rb'

describe RubyPython::PyMainClass do
  include TestConstants
  include RubyPythonStartStop

  subject { RubyPython::PyMain }

  it "should delegate to builtins" do
    subject.float(AnInt).rubify.should == AnInt.to_f
  end

  it "should handle block syntax" do
    subject.float(AnInt) {|f| f.rubify*2}.should == (AnInt.to_f * 2)
  end

  it "should allow attribute access" do
    subject.main.__name__.rubify.should == '__main__'
  end

  it "should allow global variable setting" do
    subject.x = 2
    subject.x.rubify.should == 2
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubypython-0.3.1 spec/pymainclass_spec.rb
rubypython-0.3.0 spec/pymainclass_spec.rb