#! /usr/bin/env ruby # coding: utf-8 require File.expand_path(File.dirname(__FILE__) + '/spec_helper') require 'string_escape_zsh.rb' describe String, "with chars to be escaped" do before do @s00 = "0123456789abcdefghijklmnopqrstuvwxyz" @s10 = "\\abc\\" @s11 = '/abc/' @s12 = ' abc ' @s13 = '!abc!' @s14 = '"abc"' @s15 = '#abc#' @s16 = '$abc$' @s17 = '%abc%' @s18 = ')abc)' @s19 = '(abc(' @s20 = '*abc*' @s21 = ',abc,' @s22 = '-abc-' @s23 = '.abc.' @s24 = ':abc:' @s25 = ';abc;' @s26 = 'abc\\>" @s29.escape_zsh.should == "\\?abc\\?" @s30.escape_zsh.should == "\\@abc\\@" @s31.escape_zsh.should == "\\[abc\\[" @s32.escape_zsh.should == "\\]abc\\]" @s33.escape_zsh.should == "\\^abc\\^" @s34.escape_zsh.should == "\\_abc\\_" @s35.escape_zsh.should == "\\{abc\\{" @s36.escape_zsh.should == "\\|abc\\|" @s37.escape_zsh.should == "\\}abc\\}" @s38.escape_zsh.should == "\\~abc\\~" @s39.escape_zsh.should == "\\`abc\\`" @s40.escape_zsh.should == "\\&abc\\&" @s41.escape_zsh.should == "\\+abc\\+" @s42.escape_zsh.should == "\\'abc\\'" end end