snapdragon 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/snapdragon/cli_application.rb +15 -3
- data/lib/snapdragon/spec_file.rb +3 -3
- data/lib/snapdragon/suite.rb +4 -1
- data/lib/snapdragon/version.rb +1 -1
- data/lib/snapdragon/views/run.erb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38b1616c053d2ad9d7528ef069daac831c23c7a9
|
4
|
+
data.tar.gz: 4b374604e2ea68df9a7a127608eddc783690a91e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc4ae14e6216dcc06b19ea34e9241ad012ba5db2eb80601d581f6631ec48f584f100d4857d9520ff77b6fa2ad479cb644e955b5324293d6a12ec8f48a280f410
|
7
|
+
data.tar.gz: b84cd200dffd153d9309d287f2dafac00a891e165936b843ac398e8aca9ce3aa7b01181fc16a4438c85b296fa716d63b29cc98e2e504842ca5338633dd3a7d9f
|
@@ -56,15 +56,27 @@ module Snapdragon
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def is_a_file_path_and_line_number?(arguement)
|
59
|
-
arguement =~ /^[\w\/\-\d]+[s|S]pec\.js:\d+$/
|
59
|
+
if arguement =~ /^[\w\/\-\d\.]+[s|S]pec\.js:\d+$/
|
60
|
+
return true
|
61
|
+
else
|
62
|
+
return false
|
63
|
+
end
|
60
64
|
end
|
61
65
|
|
62
66
|
def is_a_file_path?(arguement)
|
63
|
-
arguement =~ /^[\w\/\-\d]+[s|S]pec\.js$/
|
67
|
+
if arguement =~ /^[\w\/\-\d\.]+[s|S]pec\.js$/
|
68
|
+
return true
|
69
|
+
else
|
70
|
+
return false
|
71
|
+
end
|
64
72
|
end
|
65
73
|
|
66
74
|
def is_a_directory?(arguement)
|
67
|
-
arguement =~ /^[\w\/\-\d]+$/
|
75
|
+
if arguement =~ /^[\w\/\-\d\.]+$/
|
76
|
+
return true
|
77
|
+
else
|
78
|
+
return false
|
79
|
+
end
|
68
80
|
end
|
69
81
|
|
70
82
|
def run_suite
|
data/lib/snapdragon/spec_file.rb
CHANGED
@@ -6,14 +6,14 @@ module Snapdragon
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def read
|
9
|
-
f = File.open(@path, 'r')
|
9
|
+
f = File.open(File.expand_path(@path), 'r')
|
10
10
|
content = f.read
|
11
11
|
f.close
|
12
12
|
return content
|
13
13
|
end
|
14
14
|
|
15
15
|
def require_paths
|
16
|
-
f = File.open(@path, 'r')
|
16
|
+
f = File.open(File.expand_path(@path), 'r')
|
17
17
|
lines = f.readlines
|
18
18
|
f.close
|
19
19
|
|
@@ -41,7 +41,7 @@ module Snapdragon
|
|
41
41
|
initial_line_number = @line_number
|
42
42
|
initial_line_index = initial_line_number - 1
|
43
43
|
|
44
|
-
f = open(@path, 'r')
|
44
|
+
f = open(File.expand_path(@path), 'r')
|
45
45
|
lines = f.readlines
|
46
46
|
f.close
|
47
47
|
|
data/lib/snapdragon/suite.rb
CHANGED
@@ -27,12 +27,15 @@ module Snapdragon
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def output_spec_dependencies
|
30
|
-
require_content = ""
|
30
|
+
require_content = "// output spec dependencies begin here\n\n"
|
31
31
|
@require_paths.each do |require_path|
|
32
|
+
require_content << "\n\n// #{require_path} begins here\n"
|
32
33
|
f = File.open(require_path, 'r')
|
33
34
|
require_content << f.read
|
35
|
+
require_content << "\n// #{require_path} ends here\n\n"
|
34
36
|
f.close
|
35
37
|
end
|
38
|
+
require_content << "\n// output spec dependencies end here\n"
|
36
39
|
return require_content
|
37
40
|
end
|
38
41
|
|
data/lib/snapdragon/version.rb
CHANGED
@@ -5,15 +5,15 @@
|
|
5
5
|
<script type="text/javascript" src="/resources/ConsoleReporter.js"></script>
|
6
6
|
|
7
7
|
<script type="text/javascript">
|
8
|
-
|
9
|
-
|
8
|
+
// The implementation code the spec files being tested need
|
9
|
+
<%= @suite.output_spec_dependencies %>
|
10
10
|
</script>
|
11
11
|
|
12
12
|
<script type="text/javascript">
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
// The spec file contents
|
14
|
+
<% @suite.spec_files.each do |spec| %>
|
15
|
+
<%= spec.read %>
|
16
|
+
<% end %>
|
17
17
|
</script>
|
18
18
|
|
19
19
|
<script type="text/javascript">
|