Sha256: 0d23a9e334325c11973b85be175e7d666717ec115e17a4b97c07f1d890645d50

Contents?: true

Size: 1.22 KB

Versions: 15

Compression:

Stored size: 1.22 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) } || String.new
    )
  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) } || String.new
    )
    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

15 entries across 15 versions & 1 rubygems

Version Path
uricp-0.0.34 features/step_definitions/uricp_steps.rb
uricp-0.0.32 features/step_definitions/uricp_steps.rb
uricp-0.0.31 features/step_definitions/uricp_steps.rb
uricp-0.0.30 features/step_definitions/uricp_steps.rb
uricp-0.0.29 features/step_definitions/uricp_steps.rb
uricp-0.0.28 features/step_definitions/uricp_steps.rb
uricp-0.0.27 features/step_definitions/uricp_steps.rb
uricp-0.0.26 features/step_definitions/uricp_steps.rb
uricp-0.0.25 features/step_definitions/uricp_steps.rb
uricp-0.0.24 features/step_definitions/uricp_steps.rb
uricp-0.0.23 features/step_definitions/uricp_steps.rb
uricp-0.0.22 features/step_definitions/uricp_steps.rb
uricp-0.0.21 features/step_definitions/uricp_steps.rb
uricp-0.0.20 features/step_definitions/uricp_steps.rb
uricp-0.0.18 features/step_definitions/uricp_steps.rb