Sha256: 9c2c0b98379855033b3c42173b169920416b80075db0475b8295c859a552645d

Contents?: true

Size: 635 Bytes

Versions: 7

Compression:

Stored size: 635 Bytes

Contents

RSpec.describe Mutant::Result do
  let(:object) do
    Class.new do
      include Mutant::Result, Concord.new(:runtime, :killtime)

      def collection
        [[1]]
      end

      sum :length, :collection
    end.new(3.0, 1.0)
  end

  describe '.included' do
    it 'includes mixin to freeze instances' do
      expect(object.frozen?).to be(true)
    end

    it 'it makes DSL methods from Mutant::Result available' do
      expect(object.length).to be(1)
    end
  end

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

    it 'returns difference between runtime and killtime' do
      should eql(2.0)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mutant-0.8.16 spec/unit/mutant/result_spec.rb
mutant-0.8.15 spec/unit/mutant/result_spec.rb
mutant-0.8.14 spec/unit/mutant/result_spec.rb
mutant-0.8.13 spec/unit/mutant/result_spec.rb
mutant-0.8.12 spec/unit/mutant/result_spec.rb
mutant-0.8.11 spec/unit/mutant/result_spec.rb
mutant-0.8.10 spec/unit/mutant/result_spec.rb