Sha256: 36c54009d6dc55a5108ce6f3f22dfb76b7c37f243f67b8503675cf8d3e0cbba1

Contents?: true

Size: 747 Bytes

Versions: 4

Compression:

Stored size: 747 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Yardstick::Rule do
  let(:object)      { described_class.new(description) { true } }
  let(:description) { 'test rule'                               }

  describe '#eql?' do
    subject { object.eql?(other) }

    describe 'when rules are equal' do
      let(:other) { described_class.new(description) { true } }

      it 'is true' do
        should be(true)
      end
    end

    describe 'when rules are not equal' do
      let(:other) { described_class.new('other rule') { true } }

      it 'is false' do
        should be(false)
      end
    end
  end

  describe '#hash' do
    subject { object.hash }

    it 'is the expected hash' do
      should == description.hash
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yardstick-0.9.6 spec/unit/yardstick/rule_spec.rb
yardstick-0.9.5 spec/unit/yardstick/rule_spec.rb
yardstick-0.9.4 spec/unit/yardstick/rule_spec.rb
yardstick-0.9.3 spec/unit/yardstick/rule_spec.rb