test_parser 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/test_parser/test_information.rb +11 -1
- data/lib/test_parser/version.rb +1 -1
- metadata +1 -1
@@ -1,3 +1,13 @@
|
|
1
1
|
module TestParser
|
2
|
-
TestInformation
|
2
|
+
class TestInformation < Struct.new(:type, :identification, :file, :extras)
|
3
|
+
def snippet
|
4
|
+
source_code = SourceCode.for(file)
|
5
|
+
case test.type
|
6
|
+
when :rspec2
|
7
|
+
source_code.extract_code_from_line(extras[:line_number])
|
8
|
+
when :minitest
|
9
|
+
source_code.extract_method(extras[:method_name])
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
3
13
|
end
|
data/lib/test_parser/version.rb
CHANGED