Sha256: 1d1ca89d01fc03a964d7361a85b2506f570663b7825fd6f26d3f2c927b376461
Contents?: true
Size: 501 Bytes
Versions: 5
Compression:
Stored size: 501 Bytes
Contents
require "test_helper" class RenderNilTest < MiniTest::Spec Song = Struct.new(:title) describe "render_nil: true" do representer! do property :title, render_nil: true end it { _(Song.new.extend(representer).to_hash).must_equal({"title"=>nil}) } end describe "with :extend it shouldn't extend nil" do representer! do property :title, render_nil: true, extend: Class end it { _(Song.new.extend(representer).to_hash).must_equal({"title"=>nil}) } end end
Version data entries
5 entries across 5 versions & 3 rubygems