Sha256: a7349035ac3bec82c1b1c51530c5b2950d46887b8e6c5ca1bec0af9f42ef8d48

Contents?: true

Size: 695 Bytes

Versions: 3

Compression:

Stored size: 695 Bytes

Contents

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

has_rubyxl = begin
  Gem::Specification::find_by_name("rubyXL") 
rescue Gem::LoadError
  false
end

describe "Documentation", :if => has_rubyxl do

  it "can import xlsx files using RubyXL" do

    BINDINGS = {
      :planet => :B1,
      :mass => :B2,
      :force => :B3
    }

    s = Soroban::Import::rubyXL("files/Physics.xlsx", 0, BINDINGS )

    s.planet = 'Earth'
    s.mass = 80
    puts s.force          # => 783.459251241996
    s.force.should be_within(0.01).of(783.46)

    s.planet = 'Venus'
    s.mass = 80
    puts s.force          # => 710.044826106394
    s.force.should be_within(0.01).of(710.04)

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
soroban-0.7.3 spec/import_spec.rb
soroban-0.5.4 spec/import_spec.rb
soroban-0.4.0 spec/import_spec.rb