date_output 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.libs << 'test'
6
+ end
7
+
8
+ desc "Run tests"
9
+ task :default => :test
@@ -1,3 +1,3 @@
1
1
  module DateOutput
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -0,0 +1,64 @@
1
+ require 'test/unit'
2
+ require 'date_output'
3
+
4
+ class DateOutputTest < Test::Unit::TestCase
5
+ def test_full_date_with_time
6
+ assert_equal "#{Date.today.strftime("%A #{Date.today.day.ordinalize} %B %Y %H:%M%P")}",
7
+ DateOutput.full_date_with_time(Date.today,{})
8
+ end
9
+
10
+ def test_short_date_with_time
11
+ assert_equal "#{Date.today.strftime("%a #{Date.today.day.ordinalize} %b %y %H:%M%P")}",
12
+ DateOutput.short_date_with_time(Date.today,{})
13
+ end
14
+
15
+ def test_numbered_date_with_time
16
+ assert_equal "#{Date.today.strftime("%d/%m/%Y %H:%M%P")}",
17
+ DateOutput.numbered_date_with_time(Date.today,{})
18
+ end
19
+
20
+ def test_numbered_date_with_time_with_different_seperator
21
+ assert_equal "#{Date.today.strftime("%d-%m-%Y %H:%M%P")}",
22
+ DateOutput.numbered_date_with_time(Date.today,{:seperator=>"-"})
23
+ end
24
+
25
+ def test_numbered_date
26
+ assert_equal "#{Date.today.strftime("%d/%m/%Y")}",
27
+ DateOutput.numbered_date(Date.today,{})
28
+ end
29
+
30
+ def test_numbered_date_with_different_seperator
31
+ assert_equal "#{Date.today.strftime("%d-%m-%Y")}",
32
+ DateOutput.numbered_date(Date.today,{:seperator=>"-"})
33
+ end
34
+
35
+ def test_full_date
36
+ assert_equal "#{Date.today.strftime("%A #{Date.today.day.ordinalize} %B %Y")}",
37
+ DateOutput.full_date(Date.today,{})
38
+ end
39
+
40
+ def test_short_date
41
+ assert_equal "#{Date.today.strftime("%a #{Date.today.day.ordinalize} %b %y")}",
42
+ DateOutput.short_date(Date.today,{})
43
+ end
44
+
45
+ def test_long_date_no_day
46
+ assert_equal "#{Date.today.strftime("#{Date.today.day.ordinalize} %B %Y")}",
47
+ DateOutput.long_date_no_day(Date.today,{})
48
+ end
49
+
50
+ def test_short_date_no_day
51
+ assert_equal "#{Date.today.strftime("#{Date.today.day.ordinalize} %b %y")}",
52
+ DateOutput.short_date_no_day(Date.today,{})
53
+ end
54
+
55
+ def test_long_date_no_day_with_time
56
+ assert_equal "#{Date.today.strftime("#{Date.today.day.ordinalize} %B %Y %H:%M%P")}",
57
+ DateOutput.long_date_no_day_with_time(Date.today,{})
58
+ end
59
+
60
+ def test_short_date_no_day_with_time
61
+ assert_equal "#{Date.today.strftime("#{Date.today.day.ordinalize} %b %y %H:%M%P")}",
62
+ DateOutput.short_date_no_day_with_time(Date.today,{})
63
+ end
64
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: date_output
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -60,6 +60,7 @@ files:
60
60
  - lib/date_output/railtie.rb
61
61
  - lib/date_output/version.rb
62
62
  - lib/date_output/view_helpers.rb
63
+ - test/test_date_output.rb
63
64
  homepage: https://github.com/craigsheen/date_output
64
65
  licenses:
65
66
  - MIT
@@ -85,4 +86,5 @@ rubygems_version: 1.8.23
85
86
  signing_key:
86
87
  specification_version: 3
87
88
  summary: A gem to with shortcuts and simple worded outputs for dates.
88
- test_files: []
89
+ test_files:
90
+ - test/test_date_output.rb