Sha256: 56ae153ec5610cf3e2af0c9d60e08b8af8bde4937405c5c3e49131a41d2c7037
Contents?: true
Size: 1.1 KB
Versions: 205
Compression:
Stored size: 1.1 KB
Contents
require_relative '../../test_helper.rb' module Generator module Files class GeneratorCasesTest < Minitest::Test def test_available track_path = '/track' fake_filenames = %w(/track/zzz/alpha_case.rb /track/aaa/hy_phen_ated_case.rb) Dir.stub :glob, fake_filenames do assert_equal %w(alpha hy-phen-ated), GeneratorCases.available(track_path) end end def test_available_calls_glob_with_the_right_arguments track_path = '/track' expected_glob = "#{track_path}/exercises/*/.meta/generator/*_case.rb" mock_glob_call = Minitest::Mock.new mock_glob_call.expect :call, [], [expected_glob, File::FNM_DOTMATCH] Dir.stub :glob, mock_glob_call do GeneratorCases.available(track_path) end mock_glob_call.verify end def test_source_filepath track_path = '/track' slug = 'slug' expected_filename = track_path + '/exercises/slug/.meta/generator/slug_case.rb' assert_equal expected_filename, GeneratorCases.source_filepath(track_path, slug) end end end end
Version data entries
205 entries across 205 versions & 1 rubygems