Sha256: 39c3bc4c6170825756ba06eda1d0ec67fce18a54c4aca017d948a5db99853235

Contents?: true

Size: 1.5 KB

Versions: 11

Compression:

Stored size: 1.5 KB

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'

module Nwiki
  module Core
    describe Wiki do
      let(:path) { 'spec/examples/sample.git' }
      subject { described_class.new(path) }

      describe '.parser' do
        it { described_class.parser.should eq Orgmode::Parser }
      end

      describe '.canonicalize_path' do
        it { described_class.canonicalize_path('/foo/bar/').should eq 'foo/bar/' }
        it { described_class.canonicalize_path('/%E6%97%A5%E6%9C%AC%E8%AA%9E').should eq '日本語' }
      end

      describe '#find' do
        it { subject.find('/foo').should eq Page.new("Foo", "* Foo\n** Bar\n[[icon.png]]\n", Wiki.parser) }
        it { subject.find('/icon.png').should be_kind_of File }
        it { subject.find('/').should be_kind_of Directory }
        it { subject.find('/not_exist_page').should be_nil }
        it { subject.find('/1/2/a').should_not be_nil }
        it { subject.find('/日本語ディレクトリ/わたしだ').should_not be_nil }
      end

      describe '#find_directory' do
        it { subject.find_directory('/').list.should eq \
          ["1/2/a", "1/2/b", "foo", "日本語ディレクトリ/わたしだ"]
        }
      end

      describe '#title' do
        it { subject.title.should eq 'ヽ(´・肉・`)ノログ' }
      end

      describe '#subtitle' do
        it { subject.subtitle.should eq 'How do we fighting without fighting?' }
      end

      describe '#author' do
        it { subject.author.should eq 'niku' }
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nwiki-0.1.8 spec/nwiki/core/wiki_spec.rb
nwiki-0.1.7 spec/nwiki/core/wiki_spec.rb
nwiki-0.1.6 spec/nwiki/core/wiki_spec.rb
nwiki-0.1.5 spec/nwiki/core/wiki_spec.rb
nwiki-0.1.4 spec/nwiki/core/wiki_spec.rb
nwiki-0.1.3 spec/nwiki/core/wiki_spec.rb
nwiki-0.1.2 spec/nwiki/core/wiki_spec.rb
nwiki-0.1.1 spec/nwiki/core/wiki_spec.rb
nwiki-0.1.0a spec/nwiki/core/wiki_spec.rb
nwiki-0.0.11 spec/nwiki/core/wiki_spec.rb
nwiki-0.1.0 spec/nwiki/core/wiki_spec.rb