Sha256: e5025b0200d9dcb7f3ce34cff3672fcdfd782af73c92f47a3b5fc7ae43bda8f0

Contents?: true

Size: 786 Bytes

Versions: 2

Compression:

Stored size: 786 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Mutant::CLI::Classifier::Scope, '#each' do
  let(:object) { described_class.build(cache, input) }
  let(:cache)  { Mutant::Cache.new                   }
  let(:input)  { ::TestApp::Literal                  }

  context 'with a block' do
    subject { object.each {} }

    it_behaves_like 'a command method'

    it 'yield method subjects' do
      expect { |block| object.each(&block) }
        .to yield_control.exactly(7).times
    end
  end

  context 'without a block' do
   subject { object.each }

    it 'returns an enumerator' do
      should be_instance_of(to_enum.class)
    end

    it 'yield an instance subject' do
      expect { |block| object.each(&block) }
        .to yield_control.exactly(7).times
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mutant-0.3.0.rc1 spec/unit/mutant/cli/classifier/scope/each_spec.rb
mutant-0.3.0.beta22 spec/unit/mutant/cli/classifier/scope/each_spec.rb