|
Revision 6635, 0.7 kB
(checked in by hsbt, 5 years ago)
|
|
platform/tdiary/spec: merge from spec_with_rspec-fixture.
|
| Line | |
|---|
| 1 | $:.unshift(File.dirname(__FILE__)) |
|---|
| 2 | require 'spec_helper' |
|---|
| 3 | require 'time' |
|---|
| 4 | |
|---|
| 5 | describe "jdate plugin" do |
|---|
| 6 | |
|---|
| 7 | with_fixtures :date => :jwday do |
|---|
| 8 | def setup_jdate_plugin(date) |
|---|
| 9 | fake_plugin(:jdate) { |plugin| |
|---|
| 10 | plugin.date = date |
|---|
| 11 | } |
|---|
| 12 | end |
|---|
| 13 | |
|---|
| 14 | filters({ |
|---|
| 15 | :date => lambda {|val| Time.parse(val) }, |
|---|
| 16 | }) |
|---|
| 17 | |
|---|
| 18 | it ':jwday' do |date, jwday| |
|---|
| 19 | setup_jdate_plugin(date).date.strftime('%J').should == jwday |
|---|
| 20 | end |
|---|
| 21 | |
|---|
| 22 | set_fixtures([ |
|---|
| 23 | [ '20080121' => '月'], |
|---|
| 24 | [ '20080122' => '火'], |
|---|
| 25 | [ '20080123' => '水'], |
|---|
| 26 | [ '20080124' => '木'], |
|---|
| 27 | [ '20080125' => '金'], |
|---|
| 28 | [ '20080126' => '土'], |
|---|
| 29 | [ '20080127' => '日'], |
|---|
| 30 | ]) |
|---|
| 31 | end |
|---|
| 32 | end |
|---|
| 33 | |
|---|