Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test suite and an .each iterator on Language class.
- Loading branch information
Matt Colyer
committed
Nov 5, 2010
1 parent
1764870
commit f80deb1
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require File.dirname(__FILE__) + "/spec_helper" | ||
|
||
describe "A Language" do | ||
SupportedLanguages = 15 | ||
|
||
it "can list the supported language ids" do | ||
Speakeasy::Language.supported_language_ids.size.should == SupportedLanguages | ||
end | ||
|
||
it "can iterate over all supported languages" do | ||
Speakeasy::Language.each.to_a.size.should == SupportedLanguages | ||
end | ||
|
||
context "(German)" | ||
subject do | ||
Speakeasy::Language.new("de") | ||
end | ||
it "has codepoints" do | ||
subject.respond_to? :codepoints | ||
subject.codepoints.is_a? Array | ||
end | ||
|
||
it "has a native name" do | ||
subject.respond_to? :native_name | ||
subject.native_name.should == "Deutsch" | ||
end | ||
|
||
it "has a anglicized name" do | ||
subject.respond_to? :anglicized_name | ||
subject.anglicized_name.should == "German" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require 'rubygems' | ||
require File.dirname(__FILE__)+'/../lib/speakeasy' | ||
require 'rspec' |