Sha256: aece099ec1ef1ffff8f7a3e8f1d66771064326f9770a719a509d3d6c108d6134

Contents?: true

Size: 776 Bytes

Versions: 1

Compression:

Stored size: 776 Bytes

Contents

# coding: utf-8
require 'asciidammit'
describe Asciidammit do
  # keep this for handy string w/lots of symbols
  it "should demoronize the special characters provided by word" do
    expect(Asciidammit.demoronize( "—–‑­ ©®™§¶…‘’“”" )).to eq  "----  (c)[R][TM]SP...''\"\""
  end
  # the MS Word provided symbols 1 at a time
  [
   ["—", "--" ],
   ["–", "-"],
    ["‑", "-"],
    ["­", " "],
   [" ", " "],
   ["©", "(c)"],
   ["®", "[R]"],
   ["™", "[TM]"],
   ["§", "S"],
   ["¶", "P"],
   ["…", "..."],
   ["‘", "'"],
   ["’", "'"],
   ["“", "\""],
   ["”", "\""],

  ].each { |ms_symbol, ascii|
    it "should convert #{ms_symbol} to #{ascii}" do
      expect(Asciidammit.demoronize( ms_symbol)).to eq ascii
    end
  }

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
asciidammit2-0.2.0 spec/asciidammit_spec.rb