Sha256: b3d213126c663d0b7927deaa3dbdc3bdc83b709b87ba71ec4266f08544db8cf9

Contents?: true

Size: 1.33 KB

Versions: 5

Compression:

Stored size: 1.33 KB

Contents

require_relative '../../../spec_helper'

shared_examples 'single motif specified' do
  context 'single motif specified' do
    Given {
      make_model_file(sp1_f1, model_from)
    }
    Given(:motif_list) { [sp1_f1] }

    context 'when input is a pcm' do
      Given(:model_from) { 'pcm' }

      context 'pwm conversion invoked' do
        Given(:model_to) { 'pwm' }
        Then { expect(resulting_stdout).to eq sp1_f1.pwm }
      end

      context 'ppm conversion invoked' do
        Given(:model_to) { 'ppm' }
        Then { expect(resulting_stdout).to eq sp1_f1.ppm }
      end
    end
    
    context 'when input is a pwm' do
      Given(:model_from) { 'pwm' }

      context 'pcm conversion invoked' do
        Given(:model_to) { 'pcm' }
        include_examples 'yields motif conversion error'
      end

      context 'ppm conversion invoked' do
        Given(:model_to) { 'ppm' }
        include_examples 'yields motif conversion error'
      end
    end

    context 'if there exist other files in current folder' do
      Given {
        make_model_file(sp1_f1, model_from)
        make_model_file(klf4_f2, model_from)
      }
      Given(:model_from) { 'pcm' }
      Given(:model_to) { 'pwm' }
      Then { expect(resulting_stdout).to eq sp1_f1.pwm }
      Then { expect(resulting_stdout).not_to match(klf4_f2.pwm) }
    end
    
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bioinform-0.3.1 spec/cli/shared_examples/convert_motif/single_motif_specified.rb
bioinform-0.3.0 spec/cli/shared_examples/convert_motif/single_motif_specified.rb
bioinform-0.2.2 spec/cli/shared_examples/convert_motif/single_motif_specified.rb
bioinform-0.2.1 spec/cli/shared_examples/convert_motif/single_motif_specified.rb
bioinform-0.2.0 spec/cli/shared_examples/convert_motif/single_motif_specified.rb