require 'spec_helper' require "subtitle" describe "Time" do let(:o) do Subtitle end def eg(time, expected) result = o.send(:"handle_time", time) expect(result).to eq(expected) end it "" do eg(223344, ["22:33:44", "22:33:54"]) end it "" do eg(3344, ["00:33:44", "00:33:54"]) end it "" do eg(44, ["00:00:44", "00:00:54"]) end def eg_ctn(content, expected) result = o.send(:"handle_content", content) expect(result).to eq(expected) end it "" do eg_ctn(" a text ", "a text") end end