Class: ET::Exercise
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
7
8
9
|
# File 'lib/et/exercise.rb', line 7
def exists?
!dir.nil? && config["type"] == "exercise"
end
|
#run_tests ⇒ Object
3
4
5
|
# File 'lib/et/exercise.rb', line 3
def run_tests
system("rspec", "--color", "--fail-fast", spec_file)
end
|
#spec_file ⇒ Object
11
12
13
|
# File 'lib/et/exercise.rb', line 11
def spec_file
File.join(dir, "test", "#{slug.gsub("-", "_")}_test.rb")
end
|