Sha256: fb83a4f9ca06654be83e0fd6c4e2137446280b17172e957963b25f3c0df95569

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

require 'spec_helper'

describe Change do
  describe '#==' do
    context 'same change class' do
      context 'same length and end value' do
        it 'should return true' do
          c1 = LinearChange.new(:end_value => 2, :length => 1)
          c2 = LinearChange.new(:end_value => 2, :length => 1)
          (c1 == c2).should be_true
        end
      end

      context 'different length and/or end value' do
        it 'should return false' do
          c1 = LinearChange.new(:end_value => 3, :length => 1)
          c2 = LinearChange.new(:end_value => 2, :length => 1)
          (c1 == c2).should be_false
        end
      end
    end

    context 'different change class' do
      context 'same length and end value' do
        it 'should return false' do
          c1 = LinearChange.new(:end_value => 2, :length => 1)
          c2 = SigmoidChange.new(:end_value => 2, :length => 1)
          (c1 == c2).should be_false
        end
      end

      context 'different length and/or end value' do
        it 'should return false' do
          c1 = LinearChange.new(:end_value => 2, :length => 3)
          c2 = LinearChange.new(:end_value => 2, :length => 1)
          (c1 == c2).should be_false
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
variation-0.2.1 spec/change_spec.rb