Sha256: 99a456c208e4001bd51d85ed4c9fab443728d34bbe8a036975360496953572d3

Contents?: true

Size: 1.17 KB

Versions: 5

Compression:

Stored size: 1.17 KB

Contents

Then(/^the file named "(.*?)" should have a file format of "(.*?)"$/) do |filename, format|
  case format
  when 'lz4'
    assert_exact_output([0x184D2204].pack('V'),
      File.open(filename, 'rb') {|f| f.read(4) })
  when 'qcow2v3', 'qcow3'
    steps %{
      When I successfully run `qemu-img info #{filename}`
      Then the output from "qemu-img info #{filename}" should contain "file format: qcow2"
      And the output from "qemu-img info #{filename}" should contain "compat: 1.1"
    }
  else
    assert_no_partial_output([0x184D2204].pack('V'),
      File.open(filename, 'rb') {|f| f.read(4) })
    steps(%{
      When I successfully run `qemu-img info #{filename}`
      Then the output from "qemu-img info #{filename}" should contain "file format: #{format}"
      And the output from "qemu-img info #{filename}" should not contain "compat: 1.1"
    })
  end
end

Given(/^a correctly initialised cache at "(.*?)"$/) do |basedir|
  steps %{
    Given a directory named "#{basedir}/cache"
    And a directory named "#{basedir}/temp"
  }
end

Given(/^an empty directory named "([^"]*)"$/) do |dir_name|
  create_dir(dir_name)
  FileUtils.rm_rf(File.join(dir_name, '.'), :secure => true)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
uricp-0.0.5 features/step_definitions/uricp_steps.rb
uricp-0.0.4 features/step_definitions/uricp_steps.rb
uricp-0.0.3 features/step_definitions/uricp_steps.rb
uricp-0.0.2 features/step_definitions/uricp_steps.rb
uricp-0.0.1 features/step_definitions/uricp_steps.rb