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
|
require 'spec_helper'
describe ReverseMarkdown::Config do
describe '#with' do
let(:config) { ReverseMarkdown.config }
it 'takes additional options into account' do
config.with(github_flavored: :foobar) do
expect(ReverseMarkdown.config.github_flavored).to eq :foobar
end
end
it 'returns the result of a given block' do
expect(config.with { :something }).to eq :something
end
it 'resets to original settings afterwards' do
config.github_flavored = :foo
config.with(github_flavored: :bar) do
expect(ReverseMarkdown.config.github_flavored).to eq :bar
end
expect(ReverseMarkdown.config.github_flavored).to eq :foo
end
end
end
|