bait 0.5.6 → 0.5.9

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.
@@ -1,9 +1,2 @@
1
1
  %ul#builds
2
2
  %li#loading Loading builds...
3
-
4
- %hr
5
-
6
- .manual_clone
7
- Manually clone a local or remote repository:
8
- %input{:type => "text", :name => "clone_url", :class => "text"}
9
- %button Go
@@ -8,9 +8,20 @@
8
8
  %script{src:'/js/ansi2html.js'}
9
9
  %script{src:'/js/application.js'}
10
10
  %body
11
- #content
12
- = yield
13
- %hr
14
- #footer
11
+ .navbar
12
+ %a.navbar-brand{:href => "#"} Bait
13
+ %ul.nav.navbar-nav
14
+ %li.active
15
+ %a{:href => "#"} Builds
16
+ %li
17
+ .manual_clone
18
+ Manually clone a local or remote repository:
19
+ %input{:type => "text", :name => "clone_url", :class => "text"}
20
+ %button Go
21
+ .container
22
+ #content
23
+ = yield
24
+ %hr
25
+ %footer
15
26
  %center Bait/#{Bait::VERSION} #{Bait.env}
16
27
 
@@ -104,6 +104,9 @@ describe Bait::Build do
104
104
  end
105
105
  end
106
106
 
107
+ # TODO
108
+ # simplecov support => html output for a phase
109
+
107
110
  describe "simplecov support" do
108
111
  context 'has simplecov files' do
109
112
  before do
@@ -133,4 +136,18 @@ describe Bait::Build do
133
136
  end
134
137
  end
135
138
  end
139
+
140
+ describe "#phases" do
141
+ before do
142
+ FileUtils.mkdir_p build.bait_dir
143
+ File.open(File.join(build.bait_dir, "bire.yml"), "w") do |f|
144
+ f.puts "---"
145
+ f.puts "- foo.py"
146
+ f.puts "- bar.php"
147
+ end
148
+ end
149
+ it "outputs scripts in the order defined in bire.yml" do
150
+ build.phases.should eq ["foo.py", "bar.php"]
151
+ end
152
+ end
136
153
  end
@@ -1,9 +1,13 @@
1
1
  require 'spec_helper'
2
- require 'bait/tester'
2
+ require 'bait/integrator'
3
3
 
4
- describe Bait::Tester do
4
+ def expect_event(*args)
5
+ Bait.should_receive(:broadcast).with(:build, *args)
6
+ end
7
+
8
+ describe Bait::Integrator do
5
9
  let(:build) { Bait::Build.create(name: "bait", clone_url:repo_path) }
6
- let(:tester) { Bait::Tester.new }
10
+ let(:worker) { Bait::Integrator.new }
7
11
 
8
12
  describe "#perform" do
9
13
  subject { build.reload }
@@ -11,33 +15,34 @@ describe Bait::Tester do
11
15
 
12
16
  describe "real-time events" do
13
17
  before do
14
- write_script_with_status build.script("test"), 0
18
+ write_script_with_status build.script("test.sh"), 0
19
+ write_script_with_status build.script("coffeelint.rb"), 0
15
20
  end
16
21
  it "push updates directly to the browser" do
17
- Bait.should_receive(:broadcast).with(:build, :status, build.id, 'testing')
18
- Bait.should_receive(:broadcast).with(:build, :output, build.id, kind_of(String))
19
- Bait.should_receive(:broadcast).with(:build, :status, build.id, 'passed')
20
- tester.perform build.id
22
+ expect_event(:status, build.id, 'phase: test.sh')
23
+ expect_event(:status, build.id, 'phase: coffeelint.rb')
24
+ expect_event(:output, build.id, kind_of(String)).exactly(2).times
25
+ expect_event(:status, build.id, 'passed').exactly(2).times
26
+ worker.perform build.id
21
27
  end
22
28
  end
23
29
 
24
- context "build repo did not have a test script" do
30
+ context "a script is missing" do
25
31
  before do
26
- FileUtils.rm build.script("test")
27
- tester.perform build.id
32
+ FileUtils.rm build.script("test.sh")
33
+ FileUtils.rm build.script("coffeelint.rb")
34
+ worker.perform build.id
28
35
  end
29
36
  it "has errors in output" do
30
37
  build.reload.output.should match /was expected but is missing/
31
38
  end
32
- it "has a useful status" do
33
- build.reload.status.should eq "script missing"
34
- end
35
39
  end
36
40
 
37
41
  context "has a test script" do
38
42
  before do
39
- write_script_with_status build.script('test'), status
40
- tester.perform build.id
43
+ write_script_with_status build.script("coffeelint.rb"), status
44
+ write_script_with_status build.script('test.sh'), status
45
+ worker.perform build.id
41
46
  end
42
47
 
43
48
  shared_examples_for "a test run" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bait
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keyvan Fatehi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-07 00:00:00.000000000 Z
11
+ date: 2013-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -242,6 +242,8 @@ executables:
242
242
  extensions: []
243
243
  extra_rdoc_files: []
244
244
  files:
245
+ - .bait/bire.yml
246
+ - .bait/coffeelint.rb
245
247
  - .bait/test.sh
246
248
  - .gitignore
247
249
  - Gemfile
@@ -251,6 +253,7 @@ files:
251
253
  - README.md
252
254
  - Rakefile
253
255
  - VERSION
256
+ - app/css/bootstrap.css
254
257
  - app/css/build.scss
255
258
  - app/css/main.scss
256
259
  - app/js/bait.coffee
@@ -259,12 +262,17 @@ files:
259
262
  - app/js/manual_clone.coffee
260
263
  - bait.gemspec
261
264
  - bin/bait
265
+ - examples/coffeescript/coffeelint.rb
266
+ - examples/ios/test.sh
267
+ - examples/ruby/test.sh
268
+ - examples/rubymotion/test.sh
262
269
  - lib/bait.rb
263
270
  - lib/bait/api.rb
264
271
  - lib/bait/assets.rb
265
272
  - lib/bait/build.rb
266
273
  - lib/bait/build_helper.rb
267
274
  - lib/bait/cli.rb
275
+ - lib/bait/integrator.rb
268
276
  - lib/bait/object.rb
269
277
  - lib/bait/phase.rb
270
278
  - lib/bait/public/css/application.css
@@ -276,15 +284,14 @@ files:
276
284
  - lib/bait/pubsub.rb
277
285
  - lib/bait/simple_query.rb
278
286
  - lib/bait/simplecov_support.rb
279
- - lib/bait/tester.rb
280
287
  - lib/bait/version.rb
281
288
  - lib/bait/views/builds.haml
282
289
  - lib/bait/views/layout.haml
283
290
  - spec/lib/bait/analyzer_spec.rb
284
291
  - spec/lib/bait/api_spec.rb
285
292
  - spec/lib/bait/build_spec.rb
293
+ - spec/lib/bait/integrator_spec.rb
286
294
  - spec/lib/bait/pubsub_spec.rb
287
- - spec/lib/bait/tester_spec.rb
288
295
  - spec/lib/bait_spec.rb
289
296
  - spec/spec_helper.rb
290
297
  - spec/support/script_maker.rb
@@ -316,8 +323,8 @@ test_files:
316
323
  - spec/lib/bait/analyzer_spec.rb
317
324
  - spec/lib/bait/api_spec.rb
318
325
  - spec/lib/bait/build_spec.rb
326
+ - spec/lib/bait/integrator_spec.rb
319
327
  - spec/lib/bait/pubsub_spec.rb
320
- - spec/lib/bait/tester_spec.rb
321
328
  - spec/lib/bait_spec.rb
322
329
  - spec/spec_helper.rb
323
330
  - spec/support/script_maker.rb