Sha256: f107f4b8d57df629253561d518600d6cb42890900a6b6547fba9e28f34f60caa

Contents?: true

Size: 728 Bytes

Versions: 4

Compression:

Stored size: 728 Bytes

Contents

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.2 spec/semipublic/yardstick/rule_spec.rb
yardstick-0.9.1 spec/semipublic/yardstick/rule_spec.rb
yardstick-0.9.0 spec/semipublic/yardstick/rule_spec.rb
yardstick-0.8.0 spec/semipublic/yardstick/rule_spec.rb