Commit f0efecf
Changed files (2)
spec
saml
kit
cli
commands
support
spec/saml/kit/cli/commands/metadata_spec.rb
@@ -0,0 +1,14 @@
+require 'tempfile'
+
+RSpec.describe Saml::Kit::Cli::Commands::Metadata do
+ describe "#register" do
+ let(:env) { "SAMLKITRC=#{Tempfile.new('saml-kit').path}" }
+ let(:command) { "metadata register #{url}" }
+ let(:url) { 'https://saml-kit-proof.herokuapp.com/metadata' }
+
+ specify { expect(status).to be_success }
+ specify { expect(output).to include(url) }
+ specify { expect(output).to match(/EntityDescriptor/) }
+ specify { expect(output).to match(/opening connection to saml-kit-proof.herokuapp.com:443.../) }
+ end
+end
spec/support/shell_helpers.rb
@@ -2,9 +2,10 @@ RSpec.shared_context "shell execution" do
subject { execute(command) }
let(:status) { subject[0] }
let(:output) { subject[1] }
+ let(:env) { }
def execute(command, mute: false)
- full_command = "bundle exec ruby ./exe/saml-kit #{command} 2>&1"
+ full_command = "#{env} bundle exec ruby ./exe/saml-kit #{command} 2>&1"
puts full_command unless mute
output = `#{full_command}`
[$?, output]