Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/jekyll-github-metadata/value.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def render

def to_liquid
case render
when nil, true, false, Hash, String, Numeric, Array, Time
when nil, true, false, Hash, String, Numeric, Array
value
else
to_json
Expand Down
11 changes: 0 additions & 11 deletions spec/value_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
let(:nil_value_without_key) { described_class.new(nil) }
let(:nil_value_with_key) { described_class.new("my_key", nil) }
let(:key_and_value) { described_class.new("my_key2", proc { "leonard told me" }) }
let(:time_value) { described_class.new(Time.utc(2025, 1, 29, 12, 0, 0)) }

it "takes in a value and stores it" do
v = described_class.new("some_value")
Expand Down Expand Up @@ -56,16 +55,6 @@
expect(hash_value.render).to eql("hello" => "world")
end

it "does not modify a time value" do
expect(time_value.render).to be_a(Time)
expect(time_value.render).to eql(Time.utc(2025, 1, 29, 12, 0, 0))
end

it "returns Time objects directly from to_liquid for date filter compatibility" do
expect(time_value.to_liquid).to be_a(Time)
expect(time_value.to_liquid).to eql(Time.utc(2025, 1, 29, 12, 0, 0))
end

it "accepts a nil value with no key" do
expect(nil_value_without_key.key).to eql("{anonymous}")
expect(nil_value_without_key.render).to be_nil
Expand Down