Sha256: 6dbac15cfde1f9898605f34bb0b5f2a0db8dc322156f2cd89f8054288343a882

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

# -*- encoding: utf-8 -*

require 'dict/wiktionary'

describe Dict::Wiktionary do

  it "should raise no given word exception" do
    expect { Dict::Wiktionary.new }.to raise_error ArgumentError
  end

  it "should return an two element array of translations of word samochód containing [\"car\",\"automobile\"]" do
    w = Dict::Wiktionary.new('samochód').translate
    w.translations.should == {"samochód"=>["car", "automobile"]}
  end

  it "should return a hash with translations" do
    w = Dict::Wiktionary.new('samochód').translate
    w.translations.should be_a(Hash)
  end

  it "should return a Resut object" do
    w = Dict::Wiktionary.new('samochód').translate
    w.should be_a(Dict::Result)
  end
  
  it "should return translation from english to polish for word 'field'" do
    result = Dict::Wiktionary.new('field').translate.translations
    result.should eq({"field"=>["pole", "pole (magnetyczne, elektryczne, sił, itp.)", "pole (skalarne, wektorowe, itp.)", "ciało (liczb rzeczywistych, zespolonych, itp.)", "wystawić (drużynę)", "odpowiadać (na pytania)", "polowy", "polny"]})
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dict-0.2.3 spec/dict/lib_wiktionary_spec.rb