mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
added check for extension and line count on vcr_cassette? in generated
This commit is contained in:
@@ -241,6 +241,8 @@ module Linguist
|
|||||||
#
|
#
|
||||||
# Returns true or false
|
# Returns true or false
|
||||||
def vcr_cassette?
|
def vcr_cassette?
|
||||||
|
return false unless extname == '.yml'
|
||||||
|
return false unless lines.count > 2
|
||||||
# VCR Cassettes have "recorded_with: VCR" in the second last line.
|
# VCR Cassettes have "recorded_with: VCR" in the second last line.
|
||||||
return lines[-2].include?("recorded_with: VCR")
|
return lines[-2].include?("recorded_with: VCR")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user