Sha256: 2a8ad47c9feb3f74aa7557616d05d153b1018a019ae1081d7c419c6975b6f9eb

Contents?: true

Size: 980 Bytes

Versions: 1

Compression:

Stored size: 980 Bytes

Contents

# -*- encoding: utf-8 -*-
require 'spec_helper'

describe Wookie::Translator do
  before do
    @english = 'enter your text here!'
    @wookie  = 'wowhaoworc rooohurc aowokao acworcwo!'
  end

  it "should load the default dialect, if not otherwise specified" do
    t = Wookie::Translator.new
    t.to_wookie(@english).should eq(@wookie)
    t.from_wookie(@wookie).should eq(@english)
  end

  it "should translate with the simple default dialect (hash form)" do
    t = Wookie::Translator.new dialect: Wookie::Dialect::Simple
    t.to_wookie(@english).should eq(@wookie)
    t.from_wookie(@wookie).should eq(@english)
  end

  it "should raise a NotImplementedError if using an incomplete dialect" do
    t = Wookie::Translator.new dialect: Wookie::Dialect::Base
    expect {
      t.to_wookie(@english).should eq(@wookie)
    }.to raise_error(NotImplementedError)
    expect {
      t.from_wookie(@wookie).should eq(@english)
    }.to raise_error(NotImplementedError)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wookie-translator-0.1.0 spec/wookie/translator_spec.rb