guard-jasmine-node 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -6,7 +6,7 @@ JasmineNode guard automatically & intelligently executes jasmine node specs when
6
6
  It works brilliantly with Node projects whereas [guard-jasmine](https://github.com/netzpirat/guard-jasmine)
7
7
  looks better for jasmine specs in the context of e.g. a Rails app.
8
8
 
9
- * Tested against Node 0.4, jasmine-node 1.0.10
9
+ * Tested against Node 0.8.9, jasmine-node 1.0.26
10
10
 
11
11
  Requirements
12
12
  ------------
@@ -63,6 +63,9 @@ Load coffeescript and all execution of .coffee files.
63
63
 
64
64
  Execute jasmine-node in verbose mode
65
65
 
66
+ * `:spec_paths # default => [spec]`
67
+
68
+ Array of paths containing all specs (supply a comma-separated list of paths to override the default)
66
69
 
67
70
  * `:jasmine_node_bin`
68
71
 
@@ -10,15 +10,15 @@ module Guard
10
10
  :keep_failed => true,
11
11
  :notify => true,
12
12
  :coffeescript => true,
13
- :verbose => false
13
+ :verbose => false,
14
+ :spec_paths => %w(spec)
14
15
  }
15
-
16
- PATHS_FOR_ALL_SPECS = %w(spec)
17
16
 
18
17
  autoload :Runner, "guard/jasmine_node/runner"
19
18
  autoload :SpecState, "guard/jasmine_node/spec_state"
20
19
 
21
20
  def initialize(watchers = [], options = {})
21
+ options[:spec_paths] = options[:spec_paths].split(",") if options[:spec_paths].respond_to?(:split)
22
22
  super(watchers, DEFAULT_OPTIONS.merge(options))
23
23
  @state = SpecState.new
24
24
  end
@@ -28,7 +28,7 @@ module Guard
28
28
  end
29
29
 
30
30
  def run_all
31
- run(PATHS_FOR_ALL_SPECS)
31
+ run(options[:spec_paths])
32
32
  notify(:all)
33
33
  end
34
34
 
@@ -37,7 +37,7 @@ module Guard
37
37
  failing_paths + changed_paths
38
38
  else
39
39
  changed_paths
40
- end
40
+ end.uniq
41
41
 
42
42
  run(run_paths)
43
43
  notify(:some)
@@ -18,7 +18,7 @@ module Guard
18
18
 
19
19
  def self.print_message
20
20
  message = @options[:message]
21
- message ||= @paths == PATHS_FOR_ALL_SPECS ? "Running all specs" : "Running: #{@paths.join(' ')}"
21
+ message ||= @paths == @options[:spec_paths] ? "Running all specs" : "Running: #{@paths.join(' ')}"
22
22
  ::Guard::UI.info(message, :reset => true)
23
23
  end
24
24
 
@@ -19,7 +19,9 @@ module Guard
19
19
  @run_paths = run_paths
20
20
  @io = Runner.run(@run_paths, options)
21
21
  @stdout = @io[STDOUT]
22
+ @stderr = @io[STDERR]
22
23
  @exitstatus = @io[THREAD].value rescue ERROR_CODE
24
+ @stderr.lines { |line| print line }
23
25
  @stdout.lines { |line| print line }
24
26
  close_io
25
27
  update_passed_and_fixed
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module JasmineNodeVersion
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -40,6 +40,10 @@ describe Guard::JasmineNode do
40
40
  guard.options[:verbose].should be_false
41
41
  end
42
42
 
43
+ it "sets :spec_paths option an array including the spec directory" do
44
+ guard.options[:spec_paths].should =~ %w(spec)
45
+ end
46
+
43
47
  it "is passing" do
44
48
  guard.should be_passing
45
49
  end
@@ -51,6 +55,9 @@ describe Guard::JasmineNode do
51
55
 
52
56
  context "when options are given" do
53
57
  let(:a_path) { "/foo/bar/jasmine-node" }
58
+ let(:some_paths) { %w(foo bar zap) }
59
+ let(:some_comma_separated_paths) { some_paths.join(",") }
60
+
54
61
  let(:guard) { Guard::JasmineNode.new([], {
55
62
  :jasmine_node_bin => a_path,
56
63
  :all_on_start => false,
@@ -58,7 +65,8 @@ describe Guard::JasmineNode do
58
65
  :keep_failed => false,
59
66
  :notify => false,
60
67
  :coffeescript => false,
61
- :verbose => true
68
+ :verbose => true,
69
+ :spec_paths => some_comma_separated_paths
62
70
  }) }
63
71
 
64
72
  it "sets the path to jasmine-node bin" do
@@ -88,6 +96,10 @@ describe Guard::JasmineNode do
88
96
  it "sets the :verbose option" do
89
97
  guard.options[:verbose].should be_true
90
98
  end
99
+
100
+ it "sets the :spec_paths options to an array of paths given by a comma-separated string" do
101
+ guard.options[:spec_paths].should =~ some_paths
102
+ end
91
103
  end
92
104
  end
93
105
 
@@ -181,7 +193,7 @@ describe Guard::JasmineNode do
181
193
  end
182
194
 
183
195
  context "when there are failing paths" do
184
- let(:failing_paths) { %w(foo/bar zip/zap) }
196
+ let(:failing_paths) { %w(foo/bar zip/zap aaa/bbb) }
185
197
  let(:changed_paths) { %w(aaa/bbb ccc/ddd) }
186
198
  let(:all_paths) { failing_paths + changed_paths }
187
199
 
@@ -194,8 +206,8 @@ describe Guard::JasmineNode do
194
206
  guard.options[:keep_failed] = true
195
207
  end
196
208
 
197
- it "updates state with failing paths and the changed paths" do
198
- state.should_receive(:update).with(all_paths, anything)
209
+ it "updates state with the union of failing paths and the changed paths" do
210
+ state.should_receive(:update).with(all_paths.uniq, anything)
199
211
  guard.run_on_change(changed_paths)
200
212
  end
201
213
  end
@@ -70,9 +70,11 @@ describe Guard::JasmineNode::Runner do
70
70
 
71
71
  context "when no message option is given" do
72
72
  context "and running all specs" do
73
+ let(:all_paths) { %w(foo bar zap) }
74
+
73
75
  it "outputs message confirming all specs are being run" do
74
76
  Guard::UI.should_receive(:info).with("Running all specs", anything)
75
- runner.run(Guard::JasmineNode::PATHS_FOR_ALL_SPECS)
77
+ runner.run(all_paths, spec_paths: all_paths)
76
78
  end
77
79
  end
78
80
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-jasmine-node
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-29 00:00:00.000000000Z
12
+ date: 2012-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard
16
- requirement: &8090000 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0.4'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *8090000
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0.4'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rspec
27
- requirement: &8089580 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *8089580
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: guard-rspec
38
- requirement: &8089120 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *8089120
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: rake
49
- requirement: &8088700 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: '0'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *8088700
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: rb-inotify
60
- requirement: &8088240 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ! '>='
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: '0'
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *8088240
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: libnotify
71
- requirement: &8087820 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ! '>='
@@ -76,7 +101,12 @@ dependencies:
76
101
  version: '0'
77
102
  type: :development
78
103
  prerelease: false
79
- version_requirements: *8087820
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
80
110
  description: ''
81
111
  email:
82
112
  - dave@kapoq.com
@@ -122,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
152
  version: '0'
123
153
  requirements: []
124
154
  rubyforge_project: guard-jasmine-node
125
- rubygems_version: 1.8.10
155
+ rubygems_version: 1.8.24
126
156
  signing_key:
127
157
  specification_version: 3
128
158
  summary: Guard::JasmineNode automatically runs your Jasmine Node specs when files