source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/spec/acceptance/to_bytes_spec.rb@ 30903

Last change on this file since 30903 was 30903, checked in by davidb, 8 years ago

Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details

  • Property svn:executable set to *
File size: 783 bytes
Line 
1#! /usr/bin/env ruby -S rspec
2require 'spec_helper_acceptance'
3
4describe '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
27end
Note: See TracBrowser for help on using the repository browser.