File: config_spec.rb

package info (click to toggle)
ruby-reverse-markdown 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 440 kB
  • sloc: ruby: 1,452; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 716 bytes parent folder | download | duplicates (2)
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