Sha256: ea28d0c0c43e57074a87767297df429b08c2fff0d98722d0168b5b7a7650f066

Contents?: true

Size: 814 Bytes

Versions: 5

Compression:

Stored size: 814 Bytes

Contents

require './test/test_helper'

class AssignmentTest < MiniTest::Unit::TestCase

  def project_dir
    '/tmp'
  end

  def teardown
    FileUtils.rm_rf File.join(project_dir, 'ruby')
  end

  def readme_path
    File.join(project_dir, 'ruby', 'queens', 'README.md')
  end

  def tests_path
    File.join(project_dir, 'ruby', 'queens', 'test.rb')
  end

  def assignment_data
    {
      'track' => 'ruby',
      'slug' => 'queens',
      'readme' => 'Do it',
      'test_file' => 'test.rb',
      'tests' => 'assert true',
      'project_dir' => project_dir
    }
  end

  def test_write_assignment_from_project_directory
    assignment = Exercism::Assignment.new(assignment_data)
    assignment.save

    assert_equal "Do it", File.read(readme_path)
    assert_equal "assert true", File.read(tests_path)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
exercism-0.0.9 test/exercism/assignment_test.rb
exercism-0.0.8 test/exercism/assignment_test.rb
exercism-0.0.7 test/exercism/assignment_test.rb
exercism-0.0.6 test/exercism/assignment_test.rb
exercism-0.0.5 test/exercism/assignment_test.rb