Sha256: 7c94d646647ebdeb8dc4648cac7f2e4ddc4b880752edb896928dc284b39abcaa

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 KB

Contents

require 'test_helper'

module Vedeu

  module Renderers

    describe File do

      let(:described) { Vedeu::Renderers::File }
      let(:instance)  { described.new(output, options) }
      let(:output)    {}
      let(:options)   {
        {
          timestamp: timestamp
        }
      }
      let(:timestamp) { true }

      describe '#initialize' do
        it { instance.must_be_instance_of(described) }
        it { instance.instance_variable_get('@output').must_equal(output) }
        it { instance.instance_variable_get('@options').must_equal(options) }
      end

      describe '.render' do
        it { described.must_respond_to(:render) }
      end

      describe '#render' do
        let(:_time) { Time.new(2015, 4, 12, 20, 05) }

        before { File.stubs(:open) }

        subject { instance.render }

        # it { subject.must_be_instance_of(String) }

        # it { skip }
        # context 'when the timestamp option is true' do
        #   before { Time.stubs(:now).returns(_time) }

        #   it { File.expects(:open).with('/tmp/out_1428865500.0', 'w'); subject }
        # end

        # context 'when the timestamp option is false' do
        #   let(:timestamp) { false }

        #   it { File.expects(:open).with('/tmp/out', 'w'); subject }
        # end
      end

    end # File

  end # Renderers

end # Vedeu

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.4.40 test/lib/vedeu/output/renderers/file_test.rb
vedeu-0.4.39 test/lib/vedeu/output/renderers/file_test.rb