Sha256: 42f831d3632300316ee248ecbbcacbd9911b484e44740658130fb967aa5e89ed
Contents?: true
Size: 1.31 KB
Versions: 2
Compression:
Stored size: 1.31 KB
Contents
require 'cape/strings' describe Cape::Strings do describe '::pluralize' do it "should pluralize 'foo' as expected" do Cape::Strings.pluralize('foo').should == 'foos' end it "should pluralize 'foo' as expected for a count of 2" do Cape::Strings.pluralize('foo', 2).should == 'foos' end it "should not pluralize for a count of 1" do Cape::Strings.pluralize('foo', 1).should == 'foo' end it "should pluralize 'foo' as expected for a count of 0" do Cape::Strings.pluralize('foo', 0).should == 'foos' end it "should pluralize 'foo' as expected for a count of -1" do Cape::Strings.pluralize('foo', -1).should == 'foos' end end describe '::to_list_phrase' do it 'should make the expected list phrase of an empty array' do Cape::Strings.to_list_phrase([]).should == '' end it 'should make the expected list phrase of a 1-element array' do Cape::Strings.to_list_phrase(%w(foo)).should == 'foo' end it 'should make the expected list phrase of a 2-element array' do Cape::Strings.to_list_phrase(%w(foo bar)).should == 'foo and bar' end it 'should make the expected list phrase of a 3-element array' do array = %w(foo bar baz) Cape::Strings.to_list_phrase(array).should == 'foo, bar, and baz' end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cape-1.0.1 | spec/cape/strings_spec.rb |
cape-1.0.0 | spec/cape/strings_spec.rb |