~ubuntu-branches/ubuntu/saucy/tdiary/saucy-proposed

« back to all changes in this revision

Viewing changes to contrib2/spec/jyear_spec.rb

  • Committer: Bazaar Package Importer
  • Author(s): Daigo Moriwaki
  • Date: 2011-04-11 21:53:16 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110411215316-ih4gt4q8p29d2wf8
Tags: 3.0.1-1
* New upstream release (Closes: #542801, #594947)
* debian/control:
 - Bumped up Standards-Version to 3.9.1.
 - Updated version dependency.
* debian/tdiary-setup.rb: Followed the upstream changes, incorporating js and
  index.fcgi

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
$:.unshift(File.dirname(__FILE__))
 
2
require 'spec_helper'
 
3
require 'time'
 
4
 
 
5
describe "jyear plugin" do
 
6
  with_fixtures :date => :jyear do
 
7
    def setup_jyear_plugin(date)
 
8
      fake_plugin(:jyear) { |plugin|
 
9
        plugin.date = date
 
10
      }
 
11
    end
 
12
 
 
13
    it 'in :date' do |date, jyear|
 
14
      setup_jyear_plugin(date).date.strftime('%K').should == jyear
 
15
    end
 
16
 
 
17
    filters({
 
18
      :date => lambda {|val| Time.parse(val) },
 
19
    })
 
20
 
 
21
    set_fixtures([
 
22
      ['1925/01/01' => '昔々'],
 
23
      ['1926/12/25' => '昭和元年'],
 
24
      ['1927/01/01' => '昭和2' ],
 
25
      ['1989/01/08' => '平成元年' ],
 
26
      ['1990/01/01' => '平成2' ],
 
27
    ])
 
28
  end
 
29
end