Sha256: 679a7239855305b597450a1713613cf4ae2da838c5943aef572c78e3a138216e

Contents?: true

Size: 914 Bytes

Versions: 19

Compression:

Stored size: 914 Bytes

Contents

# -*- Encoding: utf-8 -*-
#
# Copyright 2013 whiteleaf. All rights reserved.
#

require "tmpdir"
require_relative "../lib/inventory"
require_relative "../lib/novelsetting"

describe NovelSetting do
  context "setting.ini 書き出し関係" do
    before do
      @tmpdir = Dir.mktmpdir
      @novel_setting = NovelSetting.new(@tmpdir, true, true)
      @inipath = File.join(@tmpdir, NovelSetting::INI_NAME)
    end

    after do
      FileUtils.remove_entry_secure @tmpdir
    end

    it "読み込んだ設定を setting.ini に書き出せるか" do
      @novel_setting.save_settings
      expect(File.exist?(@inipath)).to be_truthy
    end

    it "オリジナル設定も setting.ini に書きだされるか" do
      @novel_setting["original"] = "hoge"
      @novel_setting.save_settings
      lines = File.read(@inipath).split("\n")
      expect(lines.last).to eq 'original = "hoge"'
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
narou-2.9.5 spec/novelsetting_spec.rb
narou-2.9.4 spec/novelsetting_spec.rb
narou-2.9.3.1 spec/novelsetting_spec.rb
narou-2.9.3 spec/novelsetting_spec.rb
narou-2.9.2 spec/novelsetting_spec.rb
narou-2.9.1 spec/novelsetting_spec.rb
narou-2.9.0 spec/novelsetting_spec.rb
narou-2.8.3.1 spec/novelsetting_spec.rb
narou-2.8.3 spec/novelsetting_spec.rb
narou-2.8.2 spec/novelsetting_spec.rb
narou-2.8.1 spec/novelsetting_spec.rb
narou-2.8.0 spec/novelsetting_spec.rb
narou-2.7.2 spec/novelsetting_spec.rb
narou-2.7.1 spec/novelsetting_spec.rb
narou-2.7.0 spec/novelsetting_spec.rb
narou-2.6.1 spec/novelsetting_spec.rb
narou-2.6.0 spec/novelsetting_spec.rb
narou-2.5.2 spec/novelsetting_spec.rb
narou-2.5.1 spec/novelsetting_spec.rb