starting_blocks 0.0.28 → 0.0.29
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.
data/bin/sb
CHANGED
@@ -4,14 +4,13 @@ module StartingBlocks
|
|
4
4
|
include Displayable
|
5
5
|
|
6
6
|
def initialize options
|
7
|
-
@verbose = options[:verbose]
|
8
7
|
@use_bundler = options[:use_bundler]
|
9
8
|
@include_vendor = options[:no_vendor] != true
|
10
9
|
end
|
11
10
|
|
12
11
|
def run_files files
|
13
|
-
display "Files to run: #{files.inspect}"
|
14
12
|
files = files.select { |x| @include_vendor || x.include?('/vendor/') == false }
|
13
|
+
display "Files to run: #{files.inspect}"
|
15
14
|
StartingBlocks::Publisher.publish_files_to_run files
|
16
15
|
results = execute_these_files files
|
17
16
|
StartingBlocks::Publisher.publish_results results
|
@@ -26,7 +26,7 @@ module StartingBlocks
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def add_it(file_that_changed)
|
29
|
-
return if
|
29
|
+
return if not_concerned_about? file_that_changed
|
30
30
|
display "Adding: #{file_that_changed}"
|
31
31
|
@all_files << file_that_changed
|
32
32
|
end
|
@@ -41,14 +41,14 @@ module StartingBlocks
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def delete_it(file_that_changed)
|
44
|
-
return if
|
44
|
+
return if not_concerned_about? file_that_changed
|
45
45
|
display "Deleting: #{file_that_changed}"
|
46
46
|
@all_files.delete(file_that_changed)
|
47
47
|
end
|
48
48
|
|
49
49
|
private
|
50
50
|
|
51
|
-
def
|
51
|
+
def not_concerned_about? file
|
52
52
|
file.index('.git') == 0
|
53
53
|
end
|
54
54
|
|
@@ -0,0 +1,114 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe StartingBlocks::Runner do
|
4
|
+
let(:options) { {} }
|
5
|
+
let(:runner) { StartingBlocks::Runner.new options }
|
6
|
+
|
7
|
+
describe "run one file, no exceptions" do
|
8
|
+
let(:files) { ['test.rb'] }
|
9
|
+
let(:results) { Object.new }
|
10
|
+
|
11
|
+
before do
|
12
|
+
runner.expects(:display).with('Files to run: ["test.rb"]')
|
13
|
+
runner.expects(:execute_these_files).with(files).returns results
|
14
|
+
StartingBlocks::Publisher.expects(:publish_files_to_run).with files
|
15
|
+
StartingBlocks::Publisher.expects(:publish_results).with results
|
16
|
+
runner.expects(:puts).with results
|
17
|
+
|
18
|
+
@results = runner.run_files files
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should display the files" do
|
22
|
+
# expectation set above
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should public the files to run" do
|
26
|
+
# expectation set above
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should public the results" do
|
30
|
+
# expectation set above
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should put the results" do
|
34
|
+
# expectation set above
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should return the reuslts" do
|
38
|
+
@results.must_be_same_as results
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "run two files, no exceptions" do
|
43
|
+
let(:files) { ['test1.rb', 'test2.rb'] }
|
44
|
+
let(:results) { Object.new }
|
45
|
+
|
46
|
+
before do
|
47
|
+
runner.expects(:display).with('Files to run: ["test1.rb", "test2.rb"]')
|
48
|
+
runner.expects(:execute_these_files).with(files).returns results
|
49
|
+
StartingBlocks::Publisher.expects(:publish_files_to_run).with files
|
50
|
+
StartingBlocks::Publisher.expects(:publish_results).with results
|
51
|
+
runner.expects(:puts).with results
|
52
|
+
|
53
|
+
@results = runner.run_files files
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should display the files" do
|
57
|
+
# expectation set above
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should public the files to run" do
|
61
|
+
# expectation set above
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should public the results" do
|
65
|
+
# expectation set above
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should put the results" do
|
69
|
+
# expectation set above
|
70
|
+
end
|
71
|
+
|
72
|
+
it "should return the reuslts" do
|
73
|
+
@results.must_be_same_as results
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe "run two files, one from vendor, but no vendor allowed!" do
|
78
|
+
let(:files) { ['test1.rb', '/vendor/something_test.rb', 'test2.rb'] }
|
79
|
+
let(:options) { { no_vendor: true } }
|
80
|
+
let(:results) { Object.new }
|
81
|
+
|
82
|
+
let(:files_without_vendor) { ['test1.rb', 'test2.rb'] }
|
83
|
+
|
84
|
+
before do
|
85
|
+
runner.expects(:display).with('Files to run: ["test1.rb", "test2.rb"]')
|
86
|
+
runner.expects(:execute_these_files).with(files_without_vendor).returns results
|
87
|
+
StartingBlocks::Publisher.expects(:publish_files_to_run).with files_without_vendor
|
88
|
+
StartingBlocks::Publisher.expects(:publish_results).with results
|
89
|
+
runner.expects(:puts).with results
|
90
|
+
|
91
|
+
@results = runner.run_files files
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should display the files" do
|
95
|
+
# expectation set above
|
96
|
+
end
|
97
|
+
|
98
|
+
it "should public the files to run" do
|
99
|
+
# expectation set above
|
100
|
+
end
|
101
|
+
|
102
|
+
it "should public the results" do
|
103
|
+
# expectation set above
|
104
|
+
end
|
105
|
+
|
106
|
+
it "should put the results" do
|
107
|
+
# expectation set above
|
108
|
+
end
|
109
|
+
|
110
|
+
it "should return the reuslts" do
|
111
|
+
@results.must_be_same_as results
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: starting_blocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.29
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -131,6 +131,7 @@ files:
|
|
131
131
|
- spec/spec_helper.rb
|
132
132
|
- spec/starting_blocks/publisher_spec.rb
|
133
133
|
- spec/starting_blocks/result_parser_spec.rb
|
134
|
+
- spec/starting_blocks/runner_spec.rb
|
134
135
|
- starting_blocks.gemspec
|
135
136
|
homepage: ''
|
136
137
|
licenses:
|
@@ -147,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
147
148
|
version: '0'
|
148
149
|
segments:
|
149
150
|
- 0
|
150
|
-
hash:
|
151
|
+
hash: 277510206411069743
|
151
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
153
|
none: false
|
153
154
|
requirements:
|
@@ -156,10 +157,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
157
|
version: '0'
|
157
158
|
segments:
|
158
159
|
- 0
|
159
|
-
hash:
|
160
|
+
hash: 277510206411069743
|
160
161
|
requirements: []
|
161
162
|
rubyforge_project:
|
162
|
-
rubygems_version: 1.8.
|
163
|
+
rubygems_version: 1.8.25
|
163
164
|
signing_key:
|
164
165
|
specification_version: 3
|
165
166
|
summary: One command to run all tests, test watcher, etc.
|
@@ -167,3 +168,4 @@ test_files:
|
|
167
168
|
- spec/spec_helper.rb
|
168
169
|
- spec/starting_blocks/publisher_spec.rb
|
169
170
|
- spec/starting_blocks/result_parser_spec.rb
|
171
|
+
- spec/starting_blocks/runner_spec.rb
|