Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrew Kane
committed
Feb 5, 2012
1 parent
d3c6ad8
commit be3574d
Showing
5 changed files
with
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--format documentation |
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
#!/usr/bin/env rake | ||
require "bundler/gem_tasks" | ||
|
||
require "rspec/core/rake_task" | ||
RSpec::Core::RakeTask.new("spec") |
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,30 @@ | ||
# encoding: UTF-8 | ||
require "spec_helper" | ||
|
||
describe CLD do | ||
|
||
context "English text" do | ||
subject { CLD.detect_language("This is a test") } | ||
|
||
it { subject[:name].should eq("ENGLISH") } | ||
it { subject[:code].should eq("en") } | ||
it { subject[:reliable].should be_true } | ||
end | ||
|
||
context "French text" do | ||
subject { CLD.detect_language("plus ça change, plus c'est la même chose") } | ||
|
||
it { subject[:name].should eq("FRENCH") } | ||
it { subject[:code].should eq("fr") } | ||
it { subject[:reliable].should be_true } | ||
end | ||
|
||
context "Unknown text" do | ||
subject { CLD.detect_language("") } | ||
|
||
it { subject[:name].should eq("Unknown") } | ||
it { subject[:code].should eq("un") } | ||
it { subject[:reliable].should be_true } | ||
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,6 @@ | ||
require "rubygems" | ||
require "bundler/setup" | ||
Bundler.require(:default) | ||
|
||
RSpec.configure do |config| | ||
end |