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 collaboratorUnescape special characters in text
If have got some text include \n, \t and the like and need them to become
special characters again, you can use the #unescape_text
-method for this.
- Background
-
- Given
- I use a fixture named "cli-app"
- Scenarios
-
- Output contains \n
- Output contains \e
- Output contains \"
- Output contains \033
- Output contains \017
- Output contains \016
- Output contains \n
-
- Given
-
an executable named "bin/aruba-test-cli" with:
#!/bin/bash echo -n 'text\ntext'
- And
-
a file named "spec/unescape_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(unescape_text(last_command.output)).to eq "text\ntext" } end
- When
-
I run
rspec
- Then
- the specs should all pass
- Output contains \e
-
- Given
-
an executable named "bin/aruba-test-cli" with:
#!/bin/bash echo -n 'text\etext'
- And
-
a file named "spec/unescape_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(unescape_text(last_command.output)).to eq "texttext" } end
- When
-
I run
rspec
- Then
- the specs should all pass
- Output contains \"
-
- Given
-
an executable named "bin/aruba-test-cli" with:
#!/bin/bash echo -n 'text\"text'
- And
-
a file named "spec/unescape_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(unescape_text(last_command.output)).to eq "text\"text" } end
- When
-
I run
rspec
- Then
- the specs should all pass
- Output contains \033
-
- Given
-
an executable named "bin/aruba-test-cli" with:
#!/bin/bash echo -n 'text\033text'
- And
-
a file named "spec/unescape_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(unescape_text(last_command.output)).to eq "texttext" } end
- When
-
I run
rspec
- Then
- the specs should all pass
- Output contains \017
-
- Given
-
an executable named "bin/aruba-test-cli" with:
#!/bin/bash echo -n 'text\017text'
- And
-
a file named "spec/unescape_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(unescape_text(last_command.output)).to eq "texttext" } end
- When
-
I run
rspec
- Then
- the specs should all pass
- Output contains \016
-
- Given
-
an executable named "bin/aruba-test-cli" with:
#!/bin/bash echo -n 'text\016text'
- And
-
a file named "spec/unescape_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(unescape_text(last_command.output)).to eq "texttext" } end
- When
-
I run
rspec
- Then
- the specs should all pass
Last published almost 6 years ago by philoserf.