Sha256: a8e64f0d3ba52f254c1bbb214f974ac62e50b1dc66c866fbb8b7480c538c220e
Contents?: true
Size: 1.87 KB
Versions: 6
Compression:
Stored size: 1.87 KB
Contents
# encoding: utf-8 require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe Remarkable::Messages do subject { [1, 2, 3] } describe 'without I18n' do before(:each) do @matcher = Remarkable::Specs::Matchers::ContainMatcher.new(1, 2, 3) end it 'should provide a description' do @matcher.description.should == 'contain the given values' end it 'should provide a failure message' do @matcher.matches?([4]) @matcher.failure_message.should == 'Expected 1 is included in [4]' end it 'should provide a negative failure message' do @matcher.matches?([1]) @matcher.negative_failure_message.should == 'Did not expect 2 is included in [1]' end it 'should provide a not word' do @matcher.send(:not_word).should == 'not ' end end describe 'with I18n' do before(:all) do Remarkable.locale = :"pt-BR" end before(:each) do @matcher = Remarkable::Specs::Matchers::CollectionContainMatcher.new(1, 2, 3) end it 'should provide a default i18n scope' do @matcher.send(:matcher_i18n_scope).should == 'remarkable.specs.collection_contain' end it 'should provide a translated description' do @matcher.description.should == 'conter os valores fornecidos' end it 'should provide a translated failure message' do @matcher.matches?([4]) @matcher.failure_message.should == 'Esperava que 1 estivesse incluso em [4]' end it 'should provide a translated negative failure message' do @matcher.matches?([1]) @matcher.negative_failure_message.should == 'Não esperava que 2 estivesse incluso em [1]' end it 'should provide an i18n not word' do @matcher.send(:not_word).should == 'não ' end after(:all) do Remarkable.locale = :en end end end
Version data entries
6 entries across 6 versions & 1 rubygems