Sha256: fcd2ab8b31d050df5ed21efeb20d69e7c2c40e878777d1843ce328869bf3dda6
Contents?: true
Size: 495 Bytes
Versions: 16
Compression:
Stored size: 495 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
16 entries across 12 versions & 1 rubygems