Last change
on this file since 30960 was 30960, checked in by davidb, 8 years ago |
Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster
|
-
Property svn:executable
set to
*
|
File size:
783 bytes
|
Line | |
---|
1 | #! /usr/bin/env ruby -S rspec
|
---|
2 | require 'spec_helper_acceptance'
|
---|
3 |
|
---|
4 | describe 'to_bytes function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
|
---|
5 | describe 'success' do
|
---|
6 | it 'converts kB to B' do
|
---|
7 | pp = <<-EOS
|
---|
8 | $o = to_bytes('4 kB')
|
---|
9 | notice(inline_template('to_bytes is <%= @o.inspect %>'))
|
---|
10 | EOS
|
---|
11 |
|
---|
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")
|
---|
15 | end
|
---|
16 | end
|
---|
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'
|
---|
21 | end
|
---|
22 | describe 'failure' do
|
---|
23 | it 'handles no arguments'
|
---|
24 | it 'handles non integer arguments'
|
---|
25 | it 'handles unknown units like uB'
|
---|
26 | end
|
---|
27 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.