Class: ET::Exercise

Inherits:
Lesson show all
Defined in:
lib/et/exercise.rb

Instance Attribute Summary

Attributes inherited from Lesson

#cwd

Instance Method Summary collapse

Methods inherited from Lesson

#archive!, #dir, #initialize, #slug

Constructor Details

This class inherits a constructor from ET::Lesson

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/et/exercise.rb', line 7

def exists?
  !dir.nil? && config["type"] == "exercise"
end

#run_testsObject



3
4
5
# File 'lib/et/exercise.rb', line 3

def run_tests
  system("rspec", "--color", "--fail-fast", spec_file)
end

#spec_fileObject



11
12
13
# File 'lib/et/exercise.rb', line 11

def spec_file
  File.join(dir, "test", "#{slug.gsub("-", "_")}_test.rb")
end