Sha256: fdbc458c5f0a2b7b55bde9159df0d7d92d66f215cbbda48667e68d33614accfb
Contents?: true
Size: 787 Bytes
Versions: 19
Compression:
Stored size: 787 Bytes
Contents
require "spec_helper" describe ProjectSearch::BinaryDataDetector do it "should detect plain text files" do txt1 = File.read(project_search_fixture_dir + "/foo.txt") txt2 = File.read(project_search_fixture_dir + "/qux.rb") ProjectSearch::BinaryDataDetector.textual?(txt1).should be_true ProjectSearch::BinaryDataDetector.textual?(txt2).should be_true ProjectSearch::BinaryDataDetector.binary?(txt1).should be_false ProjectSearch::BinaryDataDetector.binary?(txt2).should be_false end it "should detect binary files" do bin = File.read(project_search_fixture_dir + "/binary_file.bin") ProjectSearch::BinaryDataDetector.textual?(bin).should be_false ProjectSearch::BinaryDataDetector.binary?(bin).should be_true end end
Version data entries
19 entries across 19 versions & 2 rubygems