Sha256: 522e7dca80f9f1dee34234d3d1b681bbfb9e73287ed5ef515b4a9bad5920ed22

Contents?: true

Size: 949 Bytes

Versions: 9

Compression:

Stored size: 949 Bytes

Contents

When /^(?:I )?open a new MAF writer$/ do
  @dst = Tempfile.new(["cuke", ".maf"])
  @writer = Bio::MAF::Writer.new(@dst)
end

When /^write the header from the original MAF file$/ do
  @writer.write_header(@parser.header)
end

When /^write a default header$/ do
  @writer.write_header(Bio::MAF::Header.default)
end

When /^write all the parsed blocks$/ do
  @writer.write_blocks(@parser.parse_blocks)
end

When /^write all the matched blocks$/ do
  @writer.write_blocks(@blocks)
end

RSpec::Matchers.define :match_except_ws do |expected|
  match do |actual|
    system("diff --ignore-space-change --brief #{expected} #{actual} >/dev/null 2>&1")
  end

  failure_message_for_should do |actual|
    msg = "File contents did not match. Diff:\n"
    msg << `diff --unified --ignore-space-change #{expected} #{actual}`
  end
end

Then /^the output should match, except whitespace, "(.+)"$/ do |ref|
  @dst.path.should match_except_ws($test_data + ref)
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bio-maf-1.0.1-java features/step_definitions/output_steps.rb
bio-maf-1.0.1 features/step_definitions/output_steps.rb
bio-maf-1.0.0-java features/step_definitions/output_steps.rb
bio-maf-1.0.0 features/step_definitions/output_steps.rb
bio-maf-0.3.2-java features/step_definitions/output_steps.rb
bio-maf-0.3.2 features/step_definitions/output_steps.rb
bio-maf-0.3.1 features/step_definitions/output_steps.rb
bio-maf-0.3.0-java features/step_definitions/output_steps.rb
bio-maf-0.3.0 features/step_definitions/output_steps.rb