File: workbook_protection.rb

package info (click to toggle)
ruby-spreadsheet 1.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,980 kB
  • sloc: ruby: 6,939; makefile: 10
file content (19 lines) | stat: -rw-r--r-- 527 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env ruby

$: << File.expand_path("../lib", File.dirname(__FILE__))

require "test/unit"
require "spreadsheet"

module Spreadsheet
  module Excel
    class TestWorkbook < Test::Unit::TestCase
      def test_password_hashing
        hashing_module = Spreadsheet::Excel::Password
        # Some examples found on the web
        assert_equal(0xFEF1, hashing_module.password_hash("abcdefghij"))
        assert_equal(hashing_module.password_hash("test"), hashing_module.password_hash("zzyw"))
      end
    end
  end
end