1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'to_bytes function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
6 it 'converts kB to B' do
9 notice(inline_template('to_bytes is <%= @o.inspect %>'))
12 apply_manifest(pp, :catch_failures => true) do |r|
13 m = r.stdout.match(/to_bytes is (\d+)\D/)
14 expect(m[1]).to eq("4096")
17 it 'works without the B in unit'
18 it 'works without a space before unit'
19 it 'works without a unit'
20 it 'converts fractions'
23 it 'handles no arguments'
24 it 'handles non integer arguments'
25 it 'handles unknown units like uB'