Sha256: 7fb4c9172d1ac9a0c34ab9f2df3dd4f91a62966f30992acd6007dc5e6e117c0a

Contents?: true

Size: 818 Bytes

Versions: 8

Compression:

Stored size: 818 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")

module Polonium
  describe "ValuesMatch" do
    attr_reader :fixture

    before do
      @fixture = Object.new
      fixture.extend ValuesMatch
    end

    describe "#values_match?" do
      it "when passed two matching strings, returns true" do
        fixture.values_match?("foo", "foo").should be_true
      end

      it "when passed two unmatching strings, returns true" do
        fixture.values_match?("foo", "bar").should be_false
      end
      
      it "when passed string and matching regexp, returns true" do
        fixture.values_match?("foo", /o/).should be_true
      end

      it "when passed string and unmatching regexp, returns true" do
        fixture.values_match?("foo", /r/).should be_false
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
polonium-0.3.3 spec/polonium/values_match_spec.rb
polonium-0.3.1 spec/polonium/values_match_spec.rb
polonium-0.3.2 spec/polonium/values_match_spec.rb
polonium-0.2.2 spec/polonium/values_match_spec.rb
polonium-0.1.1 spec/polonium/values_match_spec.rb
polonium-0.3.0 spec/polonium/values_match_spec.rb
polonium-0.2.0 spec/polonium/values_match_spec.rb
polonium-0.2.1 spec/polonium/values_match_spec.rb