Sha256: fda007ab1223cc5e3798a14e5c830dd6760450aaef227b1ef7754fb7dd8d81f9

Contents?: true

Size: 809 Bytes

Versions: 4

Compression:

Stored size: 809 Bytes

Contents

require 'test_helper'

class TestTestCase < TaskWarrior::Test::Integration::TestCase
  def test_empty
    # http://taskwarrior.org/issues/1017
    # assert_empty(export_tasks)
    
    # Use a placeholder as workaround
    task("add placeholder")
    assert_equal(1, export_tasks.size)
  end
  
  def test_import
    contents = {:description => "foobar"}
    input_file = Tempfile.new('test_simple')
    
    begin
      input_file.write(contents.to_json)
      input_file.close
      
      # TODO Replace temp file with in-process version
#     task("import <(echo '#{contents.to_json}')")
      task("import #{input_file.path}")
      
      tasks = export_tasks
      assert_equal(1, tasks.size)
      assert_equal('foobar', tasks.first['description'])
    ensure
      input_file.unlink
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
twtest-0.0.5 test/unit/test_testcase.rb
twtest-0.0.4 test/unit/test_testcase.rb
twtest-0.0.3 test/unit/test_testcase.rb
twtest-0.0.2 test/unit/test_testcase.rb