README.adoc in rspec-pgp_matchers-0.1.0 vs README.adoc in rspec-pgp_matchers-0.1.1
- old
+ new
@@ -9,10 +9,13 @@
image:https://img.shields.io/codeclimate/maintainability/riboseinc/rspec-pgp_matchers.svg[
"Code Climate", link="https://codeclimate.com/github/riboseinc/rspec-pgp_matchers"]
RSpec matchers for testing PGP-encrypted messages, and signatures.
+CAUTION: This gem is not meant to bridge GnuPG executables to production
+environments. Use it in developments and tests only.
+
IMPORTANT: This gem calls GnuPG executables internally. However, it does not
rely on machine-readable interface yet, and may easily break when they change
something in GnuPG's human-readable output. As long as it is not resolved in
a better way, we are going to maintain compatibility with the most recent
versions of GnuPG. At the moment of writing this statement, it is GnuPG 2.2.9.
@@ -83,9 +86,31 @@
expect(encrypted).to be_a_pgp_encrypted_message.encrypted_for(recipient1_uid, recipient2_uid)
# This one fails
expect(encrypted).to be_a_pgp_encrypted_message.encrypted_for(someones_uid)
----
+
+=== Running arbitrary GnuPG commands
+
+An `RSpec::PGPMatchers::GPGRunner` module can be used to run arbitrary GnuPG
+commands:
+
+[source,ruby]
+----
+RSpec::PGPMatchers::GPGRunner.run_command("--decrypt PATH_TO_FILE")
+RSpec::PGPMatchers::GPGRunner.run_command("--list-keys")
+----
+
+Also, convenient helpers are defined for two common commands:
+
+[source,ruby]
+----
+RSpec::PGPMatchers::GPGRunner.run_decrypt("encrypted_string")
+RSpec::PGPMatchers::GPGRunner.run_verify("cleartext", "signature_string")
+----
+
+In all above cases, a triple consisting of captured standard output, captured
+standard error, and `Process::Status` instance is returned.
== Development
After checking out the repo, run `bin/setup` to install dependencies.
Then, run `rake spec` to run the tests. You can also run `bin/console`