Sha256: 8dbe622dceb24ec1e0a51f5c4fabb9317a5cb9144f7a39cf4f387e42ca7aa146

Contents?: true

Size: 731 Bytes

Versions: 17

Compression:

Stored size: 731 Bytes

Contents

require "minitest/autorun"
require "minitest/unit"
require "nikki"
require 'fileutils'

class NikkiTest < MiniTest::Unit::TestCase

  include Nikki

  nikki = Generator.new
  FileUtils.rm(nikki.file) if nikki.file_exist?
  FileUtils.rm(nikki.config_file) if nikki.config_file_exist?

  def test_file_exist?
    nikki = Generator.new
    assert_equal(true,nikki.file_exist?)
  end

  def test_read_config
    nikki = Generator.new
    assert(nikki.read_config.class == Hash)
  end

  def test_updated_yesterday?
    nikki = Generator.new
    settings = nikki.read_config
    settings[:updated] = nikki.today-1
    nikki.write_config(settings)
    assert(nikki.updated_yesterday?,"Journal wasn't updated last yesterday.")
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
nikki-0.6.2 test/tc_nikki.rb
nikki-0.6.1 test/tc_nikki.rb
nikki-0.6.0 test/tc_nikki.rb
nikki-0.5.7 test/tc_nikki.rb
nikki-0.5.6 test/tc_nikki.rb
nikki-0.5.5 test/tc_nikki.rb
nikki-0.5.4 test/tc_nikki.rb
nikki-0.5.3 test/tc_nikki.rb
nikki-0.5.2 test/tc_nikki.rb
nikki-0.5.1 test/tc_nikki.rb
nikki-0.5.0 test/tc_nikki.rb
nikki-0.4.5 test/tc_nikki.rb
nikki-0.4.3 test/tc_nikki.rb
nikki-0.4.2 test/tc_nikki.rb
nikki-0.4.1 test/tc_nikki.rb
nikki-0.4.0 test/tc_nikki.rb
nikki-0.2.0 test/tc_nikki.rb