Sha256: dc596cd685358ffd2950a80ab6a43160348a9f2c264400ab0ba99d77205d1b46

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

describe "should match(expected)" do
  before(:each) do
    @expected_matcher = {'matchers' => { 'match' => 'corresponder'} }
    portuguese_language(@expected_matcher)
    Spec::Matchers.register_all_matchers
  end
  
  it "should translated the include matcher" do
    values = @expected_matcher['matchers']['match'].split('|')
    values.each do |value_method|
      Object.instance_methods.should be_include(value_method)
    end
  end
  
  it "should pass when target (String) matches expected (Regexp)" do
    "string".should corresponder(/tri/)
  end

  it "should pass when target (String) matches expected (String)" do
    "string".should corresponder("tri")
  end

  it "should fail when target (String) does not match expected (Regexp)" do
    lambda {
      "string".should corresponder(/rings/)
    }.should raise_error
  end

  it "should fail when target (String) does not match expected (String)" do
    lambda {
      "string".should corresponder("rings")
    }.should raise_error
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspec-i18n-1.1.0 spec/spec-i18n/matchers/match_spec.rb
rspec-i18n-1.0.0 spec/spec-i18n/matchers/match_spec.rb