Sha256: 9796053628d36cde37f85a9d1c7b8daed2fd0362c5258ee519d6b676fde4ac7b

Contents?: true

Size: 590 Bytes

Versions: 2

Compression:

Stored size: 590 Bytes

Contents

require 'spec_helper'
require File.join(File.dirname(__FILE__), 'parser_helper')

module RubyHackernews
  describe TimeInfoParser do

    before :each do
      @parser = TimeInfoParser.new(ParserHelper.second_line)
    end

    describe :parse do

      it "should pass the right value as the first parameter" do
        TimeInfo.should_receive(:new).with(4, anything)
        @parser.parse
      end

      it "should pass the right UoM descriptor as the second parameter" do
        TimeInfo.should_receive(:new).with(anything, "hours")
        @parser.parse
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-hackernews-1.4.0 spec/HNAPI/services/entries/parsers/time_info_parser_spec.rb
ruby-hackernews-1.3.7 spec/HNAPI/services/entries/parsers/time_info_parser_spec.rb