spec/inputs/graphite_spec.rb in logstash-input-graphite-2.0.2 vs spec/inputs/graphite_spec.rb in logstash-input-graphite-2.0.3
- old
+ new
@@ -49,25 +49,25 @@
expect(result.size).to eq(1)
expect(result.first.to_hash).to include({"a.b.c" => 10.2})
end
it "should support using N as current timestamp" do
- time = LogStash::Timestamp.new(Time.now)
- expect(Time).to receive(:now) { time }
+ time = LogStash::Timestamp.now
+ expect(LogStash::Timestamp).to receive(:now) { time }
result = helper.pipelineless_input(subject, 1) do
client.write "a.b.c 10 N\n"
end
expect(result.size).to eq(1)
expect(result.first["@timestamp"]).to eq(time)
end
it "should support using N as current timestamp" do
- time = Time.at(Time.now.to_i) # truncate at the second
+ time = Time.now
result = helper.pipelineless_input(subject, 1) do
client.write "a.b.c 10 #{time.to_i}\n"
end
expect(result.size).to eq(1)
- expect(result.first["@timestamp"]).to eq(LogStash::Timestamp.new(time))
+ expect(result.first["@timestamp"]).to eq(LogStash::Timestamp.at(time.to_i))
end
end
it_behaves_like "an interruptible input plugin" do
let(:config) { { "port" => port } }