Sha256: e3d105f851b0de392de1d5079f9cf69f84e79d29080e2a985968f567cb498130

Contents?: true

Size: 428 Bytes

Versions: 2

Compression:

Stored size: 428 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe String do
  describe "#lang" do
    before do
      stub_request(:post, "http://ws.detectlanguage.com/0.2/detect").
        with(:body => {"q"=>"こんにちは", "key"=>"valid_api_key"}).
        to_return(:body => load_fixture("response"))
    end

    it "should return an array of detected languages" do
      'こんにちは'.lang.should == ["ja", "zh"]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
linguo-0.0.2 spec/linguo/core_ext_spec.rb
linguo-0.0.1 spec/linguo/core_ext_spec.rb