1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
require 'spec_helper'
describe ReverseMarkdown::Converters::Del do
let(:converter) { ReverseMarkdown::Converters::Del.new }
context 'with github_flavored = true' do
before { ReverseMarkdown.config.github_flavored = true }
it 'converts the input as expected' do
input = node_for('<del>deldeldel</del>')
expect(converter.convert(input)).to eq '~~deldeldel~~'
end
it 'converts the input as expected' do
input = node_for('<s>strike that</s>')
expect(converter.convert(input)).to eq '~~strike that~~'
end
it 'skips empty tags' do
input = node_for('<del></del>')
expect(converter.convert(input)).to eq ''
end
it 'knows about its enabled/disabled state' do
expect(converter).to be_enabled
expect(converter).not_to be_disabled
end
end
context 'with github_flavored = false' do
before { ReverseMarkdown.config.github_flavored = false }
it 'does not convert anything' do
input = node_for('<del>deldeldel</del>')
expect(converter.convert(input)).to eq 'deldeldel'
end
it 'knows about its enabled/disabled state' do
expect(converter).not_to be_enabled
expect(converter).to be_disabled
end
end
end
|