1 require 'spec_helper_acceptance'
3 describe 'to_bytes function' do
7 notice(inline_template('to_bytes is <%= @o.inspect %>'))
9 it 'converts kB to B' do
10 apply_manifest(pp, :catch_failures => true) do |r|
11 m = r.stdout.match(%r{to_bytes is (\d+)\D})
12 expect(m[1]).to eq('4096')
15 it 'works without the B in unit'
16 it 'works without a space before unit'
17 it 'works without a unit'
18 it 'converts fractions'
21 it 'handles no arguments'
22 it 'handles non integer arguments'
23 it 'handles unknown units like uB'