Sha256: a36b51faeac7d408ee24aa3bd2cb3b356f6a024f1db6ea8b4f789993971823ed
Contents?: true
Size: 713 Bytes
Versions: 22
Compression:
Stored size: 713 Bytes
Contents
require 'spec_helper' require 'binary_data_checker' describe Mirage::BinaryDataChecker do BinaryDataChecker = Mirage::BinaryDataChecker include_context :resources it 'should find binary data' do BinaryDataChecker.contains_binary_data?(File.read("#{resources_dir}/binary.file")).should == true end it 'should not find binary data' do BinaryDataChecker.contains_binary_data?("string").should == false end it 'should clean up the temporary file created when checking string content' do tmpfile = Tempfile.new("file") Tempfile.should_receive(:new).and_return tmpfile FileUtils.should_receive(:rm).with(tmpfile.path) BinaryDataChecker.contains_binary_data?("string") end end
Version data entries
22 entries across 22 versions & 1 rubygems