Sha256: bf69fbc4662db150f0ddafb9f2e00da387dca0aea23a12b46da519a5dbc2300b

Contents?: true

Size: 979 Bytes

Versions: 8

Compression:

Stored size: 979 Bytes

Contents

require 'spec_helper'

describe Mutant::CLI::Classifier, '.build' do
  subject { described_class.build(cache, input) }

  let(:cache) { double('Cache') }

  this_spec = 'Mutant::CLI::Classifier.build'

  shared_examples_for this_spec do
    it 'shoud return expected instance' do
      should eql(expected_class.new(cache, expected_class::REGEXP.match(input)))
    end

    let(:expected_class) { Mutant::CLI::Classifier::Method }
  end

  context 'with explicit toplevel scope' do

    let(:input) { '::TestApp::Literal#string' }

    it_should_behave_like this_spec
  end

  context 'with instance method notation' do

    let(:input) { 'TestApp::Literal#string' }

    it_should_behave_like this_spec
  end

  context 'with singleton method notation' do
    let(:input) { 'TestApp::Literal.string' }

    it_should_behave_like this_spec
  end

  context 'with invalid notation' do
    let(:input) { '::' }

    it 'should return nil' do
      should be(nil)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutant-0.3.0.beta21 spec/unit/mutant/cli/classifier/class_methods/build_spec.rb
mutant-0.3.0.beta20 spec/unit/mutant/cli/classifier/class_methods/build_spec.rb
mutant-0.3.0.beta19 spec/unit/mutant/cli/classifier/class_methods/build_spec.rb
mutant-0.3.0.beta18 spec/unit/mutant/cli/classifier/class_methods/build_spec.rb
mutant-0.3.0.beta17 spec/unit/mutant/cli/classifier/class_methods/build_spec.rb
mutant-0.3.0.beta16 spec/unit/mutant/cli/classifier/class_methods/build_spec.rb
mutant-0.3.0.beta15 spec/unit/mutant/cli/classifier/class_methods/build_spec.rb
mutant-0.3.0.beta14 spec/unit/mutant/cli/classifier/class_methods/build_spec.rb