date_output 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +8 -0
- data/lib/date_output/version.rb +1 -1
- data/test/test_date_output.rb +64 -0
- metadata +4 -2
data/Rakefile
CHANGED
data/lib/date_output/version.rb
CHANGED
@@ -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.
|
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
|