File: jmonth_spec.rb

package info (click to toggle)
tdiary-contrib 5.0.11-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,660 kB
  • sloc: ruby: 17,024; lisp: 546; xml: 451; php: 61; sql: 40; makefile: 18
file content (28 lines) | stat: -rw-r--r-- 702 bytes parent folder | download | duplicates (3)
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
# -*- coding: utf-8 -*-

$:.unshift(File.dirname(__FILE__))
require 'spec_helper'
require 'time'

describe "jmonth plugin" do
  {
    '2007/01/01' => '睦月',
    '2007/02/01' => '如月',
    '2007/03/01' => '弥生',
    '2007/04/01' => '卯月',
    '2007/05/01' => '皐月',
    '2007/06/01' => '水無月',
    '2007/07/01' => '文月',
    '2007/08/01' => '葉月',
    '2007/09/01' => '長月',
    '2007/10/01' => '神無月',
    '2007/11/01' => '霜月',
    '2007/12/01' => '師走'
  }.each do |k,v|
    it { expect(setup_jmonth_plugin(Time.parse(k)).date.strftime('%i')).to eq(v) }
  end

  def setup_jmonth_plugin(date)
    fake_plugin(:jmonth) { |plugin| plugin.date = date }
  end
end