Skip to content

Instantly share code, notes, and snippets.

@lawrencejones
Created June 1, 2013 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lawrencejones/5690791 to your computer and use it in GitHub Desktop.
Save lawrencejones/5690791 to your computer and use it in GitHub Desktop.
A simple test for our c libraries
context 'with invalid files' do
it 'detects size above 2^16 bytes' do
file = Utilities.openFile path + 'C_large'
size = Utilities.getSize file
# invalid file, should exceed limit
size.should_not be < 65536
end
it 'detects nonexistant file' do
file = Utilities.openFile path + 'Ghost'
# invalid should point to it's initialized value- 0
file.address.should eq(0)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment