spec/timber/events/custom_spec.rb in timber-2.6.1 vs spec/timber/events/custom_spec.rb in timber-2.6.2
- old
+ new
@@ -17,6 +17,20 @@
data = custom_event.data
expect(data[:time_ms]).to be_kind_of(Float)
expect(data[:time_ms]).to be > 0.0
end
end
-end
\ No newline at end of file
+
+ describe "#new" do
+ it "does not require data key" do
+ custom_event = described_class.new(:type => "my type", :message => "hello")
+ end
+ end
+
+ describe "#as_json" do
+ it "should render an empty data hash" do
+ custom_event = described_class.new(:type => "my type", :message => "hello")
+ hash = custom_event.as_json()
+ expect(hash).to eq({:custom => {:"my type" => {}}})
+ end
+ end
+end