spec/spec-i18n/matchers/equal_spec.rb in rspec-i18n-1.1.0 vs spec/spec-i18n/matchers/equal_spec.rb in rspec-i18n-1.2.0
- old
+ new
@@ -1,26 +1,47 @@
require "spec_helper"
module Spec
module Matchers
+
describe 'equal' do
+
before(:each) do
- @expected_matcher = {'matchers' => {'equal' => 'igual|igual_a'}}
- portuguese_language(@expected_matcher)
+ @keywords = {'matchers' => {'equal' => 'igual|igual_a'}}
+ stub_language!("pt", @keywords)
Spec::Matchers.register_all_matchers
end
- it 'should register the methods for the value equal matcher' do
- values = @expected_matcher['matchers']['equal'].split('|')
- values.each { |method_name| Object.instance_methods.should be_include(method_name) }
+ it 'should translated the methods for the value equal matcher' do
+ [:igual, :igual_a].each do |translated_matcher|
+ methods.to_symbols.should include(translated_matcher)
+ end
end
+ it "should translated the methods with '?' char" do
+ [:igual?, :igual_a?].each do |translated_method|
+ methods.to_symbols.should include(translated_method)
+ end
+ end
+
it "should match when actual.equal?(expected)" do
1.should igual(1)
end
-
+
+ it "should be true when actual.equal?(expected) with ?" do
+ 1.igual?(1).should be_true
+ 1.should be_igual(1)
+ end
+
it "should not match when !actual.equal?(expected)" do
- 1.should_not igual_a("1")
+ 1.should_not be_igual_a("1")
end
+
+ it "should not match when !actual.equal?(expected) with ?" do
+ 1.igual_a?(1).should be_true
+ 1.should be_igual_a(1)
+ end
+
end
+
end
end
\ No newline at end of file