File: configuration_spec.rb

package info (click to toggle)
tdiary 5.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,092 kB
  • sloc: ruby: 23,031; javascript: 1,029; xml: 325; makefile: 26; sh: 2
file content (32 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (6)
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
require 'spec_helper'

require 'tdiary'
require 'tdiary/configuration'

describe TDiary::Configuration do
  let(:tdiary_conf) { File.expand_path("../../fixtures/tdiary.conf.webrick", __FILE__) }
  let(:work_conf) { File.expand_path('../../../tdiary.conf', __FILE__) }

  before do
    FileUtils.cp_r tdiary_conf, work_conf, verbose: false
  end

  after do
    FileUtils.rm_rf work_conf
  end

  describe "TDiary.configuration" do
    before do
      @obj = TDiary.configuration
    end

    it { expect(@obj.class).to eq TDiary::Configuration }
    it "singleton" do
      expect(@obj).to eq TDiary.configuration
    end
  end

  it "TDiary.configuration.attribute" do
    expect(TDiary.configuration.style).to eq("Wiki")
  end
end