aboutsummaryrefslogtreecommitdiffstats
path: root/lib/url.h
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-02-16 13:17:52 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2008-02-16 13:17:52 +0000
commitaf97b234ad86fb9d69aa744af426591e4b1eaf97 (patch)
tree43f9ffe48e1d4d40e7fb2ed8739d77f7cf271ff0 /lib/url.h
parent2799ff94059f496b59420d04ec4f41f67aab2b9d (diff)
Improved sasl_get_part() to deal with whitespace in challenge strings, as
described in RFC 2831 secion 7.1 (the #rule description). Closes bug #362.
Diffstat (limited to 'lib/url.h')
0 files changed, 0 insertions, 0 deletions
Unnamed repository; edit this file 'description' to name the repository.MimesBrønn
aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails/backend_spec.rb
blob: e0df1e7255ee5b25f67e25ab50c780ecbd4ddad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require File.expand_path("../spec_helper", File.dirname(__FILE__))

describe GettextI18nRails::Backend do
  it "redirects calls to another I18n backend" do
    subject.backend.should_receive(:xxx).with(1,2)
    subject.xxx(1,2)
  end

  describe :available_locales do
    it "maps them to FastGettext" do
      FastGettext.should_receive(:available_locales).and_return [:xxx]
      subject.available_locales.should == [:xxx]
    end

    it "and returns an empty array when FastGettext.available_locales is nil" do
      FastGettext.should_receive(:available_locales).and_return nil
      subject.available_locales.should == []
    end
  end

  describe :translate do
    it "uses gettext when the key is translatable" do
      FastGettext.stub(:current_repository).and_return 'xy.z.u'=>'a'
      subject.translate('xx','u',:scope=>['xy','z']).should == 'a'
    end

    it "interpolates options" do
      FastGettext.stub(:current_repository).and_return 'ab.c'=>'a%{a}b'
      subject.translate('xx','c',:scope=>['ab'], :a => 'X').should == 'aXb'
    end

    it "can translate with gettext using symbols" do
      FastGettext.stub(:current_repository).and_return 'xy.z.v'=>'a'
      subject.translate('xx',:v ,:scope=>['xy','z']).should == 'a'
    end

    it "can translate with gettext using a flat scope" do
      FastGettext.stub(:current_repository).and_return 'xy.z.x'=>'a'
      subject.translate('xx',:x ,:scope=>'xy.z').should == 'a'
    end

    it "uses the super when the key is not translatable" do
      lambda{subject.translate('xx','y',:scope=>['xy','z'])}.should raise_error(I18n::MissingTranslationData)
    end
  end
end