diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..90b1eea --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,3 @@ +# Requires supporting ruby files with custom matchers and macros, etc, +# in spec/support/ and its subdirectories. +Dir[File.join("./spec/support/**/*.rb")].each {|f| require f} diff --git a/spec/support/example_groups/integration_example_group.rb b/spec/support/example_groups/integration_example_group.rb new file mode 100644 index 0000000..503e667 --- /dev/null +++ b/spec/support/example_groups/integration_example_group.rb @@ -0,0 +1,36 @@ +require 'active_support/concern' +require 'aruba/api' + +module IntegrationExampleGroup + extend ActiveSupport::Concern + + included do + metadata[:type] = :integration + + let(:executable) { "aeolus" } + let(:command) { "" } + let(:params) { "" } + let(:cmd) { [ executable, command, params ].select{|s| !s.empty?}.join(' ') } + + before(:each) do + run_simple(unescape(cmd), false) + end + + subject do + groups = example.example_group.ancestors.clone + groups << example.example_group + if groups.find{|g| g.metadata[:example_group][:description] == "stdout"} + all_stdout + elsif groups.find{|g| g.metadata[:example_group][:description] == "stderr"} + all_stderr + end + end + end + + RSpec.configure do |config| + config.include Aruba::Api + config.include self, + :type => :integration, + :example_group => { :file_path => %r(spec/integration) } + end +end