Sha256: c9127a957af9c5a8d673ca38622621fe51c1ff2f4ad7079e652e21f9fae818ef

Contents?: true

Size: 925 Bytes

Versions: 2

Compression:

Stored size: 925 Bytes

Contents

require 'spec_helper'

describe JTSK::Converter do
  let(:converter) { described_class.new }
  let(:x) { 1043033.89 }
  let(:y) { 738371.58 }
  let(:result) { converter.to_wgs48(x,y) }

  it 'EPS is properly set' do
    expect(described_class::EPS).to eq(1e-4)
  end

  it 'can be initialized' do
    expect(converter).to be_kind_of(described_class)
  end

  it 'result is JTSK::Result' do
    expect(result).to be_kind_of(JTSK::Wgs48Result)
  end

  context 'Club Velbloud' do
    let(:x) { 1043033.89 }
    let(:y) { 738371.58 }
    it 'calucaltes well' do
      expect(result.latitude).to eq(50.092696246901404)
      expect(result.longitude).to eq(14.482746557404647)
    end
  end

  context 'Indian Bar' do
    let(:x) { 1043070.32 }
    let(:y) { 738988.72 }
    it 'calculates well' do
      expect(result.latitude).to eq(50.091628136117045)
      expect(result.longitude).to eq(14.474266228665831)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jtsk-0.0.2 spec/jtsk/converter_spec.rb
jtsk-0.0.1 spec/jtsk/converter_spec.rb