Use Aruba with RSpec
mainTo integrate Aruba with RSpec:
- Require the Aruba RSpec extension in your
spec/spec_helper.rbfile:require 'aruba/rspec' - Define your specs using the
:type => :arubametadata. - Use helper methods like
write_file,run_command, and matchers onlast_command_started(e.g.,have_output). - Run your tests using
bundle exec rspec.
# spec/spec_helper.rb
require 'aruba/rspec'
# Example spec
RSpec.describe 'First Run', :type => :aruba do
let(:file) { 'file.txt' }
let(:content) { 'Hello, Aruba!' }
before { write_file file, content }
before { run_command('aruba-test-cli file.txt') }
it { expect(last_command_started).to have_output content }
end