Sha256: ada6628cc38ac2e79166d5d8ed7f8635599f1a2cade76fa2bf2d3945aa0ef261

Contents?: true

Size: 1.25 KB

Versions: 4

Compression:

Stored size: 1.25 KB

Contents

require 'spec_helper'

module DevelopWithPassion
  module Fakes
    module RSpec
      describe Occurances do
        context "when creating an exact occurance matcher" do
          subject{Occurances.exact(1)}

          it "should create a matcher that matches an exact number of occurances" do
            subject.is_satisfied_by(1).should be_true
            subject.is_satisfied_by(2).should be_false
          end
        end

        context "when creating an at least occurance matcher" do
          subject{Occurances.at_least(3)}

          it "should create a matcher that matches an exact number of occurances" do
            subject.is_satisfied_by(3).should be_true
            subject.is_satisfied_by(4).should be_true
            subject.is_satisfied_by(2).should be_false
          end
        end
        context "when creating an at most occurance matcher" do
          subject{Occurances.at_most(3)}

          it "should create a matcher that matches an exact number of occurances" do
            subject.is_satisfied_by(3).should be_true
            subject.is_satisfied_by(2).should be_true
            subject.is_satisfied_by(1).should be_true
            subject.is_satisfied_by(4).should be_false
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
developwithpassion_fakes-rspec-0.0.8 spec/specs/occurances_spec.rb
developwithpassion_fakes-rspec-0.0.7 spec/specs/occurances_spec.rb
developwithpassion_fakes-rspec-0.0.6 spec/specs/occurances_spec.rb
developwithpassion_fakes-rspec-0.0.5 spec/specs/occurances_spec.rb