To add a collaborator to this project you will need to use the Relish gem to add the collaborator via a terminal command. Soon you'll be able to also add collaborators here!
More about adding a collaboratorExtract text from output
If you need to strip down some command output to plain text, you can use the
#extract_text
-method for this.
- Background
-
- Given
- I use a fixture named "cli-app"
- Scenarios
-
- Output contains ansi escape codes prefixed by \e
-
- Given
-
an executable named "bin/aruba-test-cli" with:
#!/bin/bash echo -n "\e[31mText"
- And
-
a file named "spec/extract_text_spec.rb" with:
require 'spec_helper' RSpec.describe 'Run command', :type => :aruba do before(:each) { run('cli') } before(:each) { stop_all_commands } it { expect(extract_text(unescape_text(last_command.output))).to eq "Text" } end
- When
-
I run
rspec
- Then
- the specs should all pass
- Output contains ansi escape codes prefixed by \033
-
- Given
-
an executable named "bin/aruba-test-cli" with:
#!/bin/bash echo -n "\033[31mText"
- And
-
a file named "spec/extract_text_spec.rb" with:
require 'spec_helper' RSpec.describe 'Run command', :type => :aruba do before(:each) { run('cli') } before(:each) { stop_all_commands } it { expect(extract_text(unescape_text(last_command.output))).to eq "Text" } end
- When
-
I run
rspec
- Then
- the specs should all pass
Last published almost 6 years ago by philoserf.