File: sign_part_test.rb

package info (click to toggle)
ruby-mail-gpg 0.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 328 kB
  • sloc: ruby: 2,289; makefile: 6
file content (22 lines) | stat: -rw-r--r-- 533 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'test_helper'
require 'mail/gpg/sign_part'

class SignPartTest < MailGpgTestCase
  context 'SignPart' do
    setup do
      set_passphrase('abc')
      @mail = Mail.new do
        to 'jane@foo.bar'
        from 'joe@foo.bar'
        subject 'test'
        body 'i am unsigned'
      end
    end

    should 'roundtrip successfully' do
      set_passphrase('abc')
      signature_part = Mail::Gpg::SignPart.new(@mail, password: 'abc')
      assert Mail::Gpg::SignPart.signature_valid?(@mail, signature_part)
    end
  end
end