motion-specwrap 0.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6f5af6c50b911f217f862639cc7d628771fd71ad
4
+ data.tar.gz: 6dd5a42a082204420641bb7dc0852837edeceec5
5
+ SHA512:
6
+ metadata.gz: aa626f1d1c722761a6d89f30f0b13c3500e082bc27c12aeed33077e15c3451001116c10114d135f4082addf26c9b8878ac79f75f656c473a1410ba3ffaf7f4e6
7
+ data.tar.gz: d39bbf5cdc9b8740af9fbd8989258a083f5f2168de78bcbadb2c43240f6e90977a635b925ec5a5eeee52b2aabea2c4751c4e7ce20505fbfebe600f33679d04fd
data/README.md CHANGED
@@ -14,5 +14,42 @@ Now you may execute `bundle exec motion-specwrap` instead of `bundle exec rake s
14
14
  1. Bacon is made to output its exit status code to standard output, such that:
15
15
  2. A wrapper script is provided which runs rake spec as normal, checks the exit status code printed by Bacon, and uses it to exit with the correct exit status code.
16
16
 
17
- ### Final Remarks
18
- I am hoping that lrz goes ahead and solves the original problem in a later patch to RubyMotion. Until then, we can use this.
17
+ ### Update: July 30, 2013
18
+
19
+ I'm back on the RM scene again, setting up CI, etc.
20
+
21
+ Unfortunately it looks like HipByte's fix has regressed in that failing
22
+ specs should NOT be returning an exit status of 0.
23
+
24
+ This means this gem has again become relevant.
25
+
26
+ There were some issues with it but I've just released v1.0.0 which is a
27
+ true wrapper and does not monkeypatch anything like the previous v0.1
28
+ did.
29
+
30
+ ```
31
+ minivan:baitmotion (master*) $ rake spec
32
+ Build ./build/iPhoneSimulator-6.1-Development
33
+ Link ./build/iPhoneSimulator-6.1-Development/baitmotion_spec.app/baitmotion
34
+ Create ./build/iPhoneSimulator-6.1-Development/baitmotion_spec.app/Info.plist
35
+ Create ./build/iPhoneSimulator-6.1-Development/baitmotion_spec.app/PkgInfo
36
+ Create ./build/iPhoneSimulator-6.1-Development/baitmotion_spec.dSYM
37
+ Simulate ./build/iPhoneSimulator-6.1-Development/baitmotion_spec.app
38
+ 2013-07-30 19:25:26.772 baitmotion[42697:c07] Application windows are expected to have a root view controller at the end of application launch
39
+ Application 'baitmotion'
40
+ - has one window [FAILED - 1.==(2) failed]
41
+
42
+ Bacon::Error: 1.==(2) failed
43
+ spec.rb:690:in `satisfy:': Application 'baitmotion' - has one window
44
+ spec.rb:704:in `method_missing:'
45
+ spec.rb:315:in `block in run_spec_block'
46
+ spec.rb:439:in `execute_block'
47
+ spec.rb:315:in `run_spec_block'
48
+ spec.rb:330:in `run'
49
+
50
+ 1 specifications (1 requirements), 1 failures, 0 errors
51
+ minivan:baitmotion (master*) $ echo $?
52
+ 0
53
+ ```
54
+
55
+ That is not supposed to be 0! I will need to continue supporting this gem in the meanwhile but I have contacted HipByte about this.
data/bin/motion-specwrap CHANGED
@@ -1,18 +1,24 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'tempfile'
3
+ require 'open3'
3
4
 
4
- regexp = /Specwrap captured exit status code: (\d*)/
5
+ regexp = / (\d*) failures, (\d*) errors/
6
+
7
+ $Run = true
5
8
 
6
9
  def watch_for(file, pattern)
7
10
  linebuf = ""
8
11
  f = File.open(file,"r")
9
12
  f.seek(0,IO::SEEK_END)
10
- while true do
13
+ while $Run do
11
14
  select([f])
12
15
  line = f.gets
13
16
  if !line.nil?
14
17
  if (matches = line.match(pattern))
15
- exit(matches[1].to_i)
18
+ exit_value = matches[1].to_i+matches[2].to_i
19
+ puts line
20
+ puts " * motion-specwrap read the summary to exit(#{exit_value})"
21
+ exit(exit_value)
16
22
  else
17
23
  if line.include? "\n"
18
24
  puts linebuf + line
@@ -31,13 +37,19 @@ begin
31
37
  file_watch_thread = Thread.new do
32
38
  watch_for(file.path, regexp)
33
39
  end
40
+
34
41
  Open3.popen2e("rake spec > #{file.path}") do |stdin, out_and_err, wait_thr|
35
42
  while (line = out_and_err.gets)
36
43
  puts line
37
44
  end
45
+ puts " * motion-specwrap should have exited already -- could not determine the correct exit value"
46
+ $Run = false
38
47
  end
48
+ rescue => ex
49
+ puts ex
39
50
  ensure
40
- file_watch_thread.join unless file_watch_thread.nil?
51
+ file_watch_thread.join
41
52
  file.close
42
53
  file.unlink
43
- end
54
+ end
55
+
@@ -1,5 +1,5 @@
1
1
  module Motion
2
2
  module Specwrap
3
- VERSION = "0.1"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,32 +1,23 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: motion-specwrap
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- version: "0.1"
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
9
5
  platform: ruby
10
- authors:
6
+ authors:
11
7
  - Keyvan Fatehi
12
8
  autorequire:
13
9
  bindir: bin
14
10
  cert_chain: []
15
-
16
- date: 2012-06-07 00:00:00 -07:00
17
- default_executable:
11
+ date: 2013-07-31 00:00:00.000000000 Z
18
12
  dependencies: []
19
-
20
13
  description: Exit value support wrapper for RubyMotion's 'rake spec'
21
- email:
14
+ email:
22
15
  - keyvanfatehi@gmail.com
23
- executables:
16
+ executables:
24
17
  - motion-specwrap
25
18
  extensions: []
26
-
27
19
  extra_rdoc_files: []
28
-
29
- files:
20
+ files:
30
21
  - .gitignore
31
22
  - Gemfile
32
23
  - LICENSE
@@ -34,39 +25,29 @@ files:
34
25
  - Rakefile
35
26
  - bin/motion-specwrap
36
27
  - lib/motion-specwrap.rb
37
- - lib/motion-specwrap/config.rb
38
- - lib/motion-specwrap/spec_setup.rb
39
28
  - lib/motion-specwrap/version.rb
40
29
  - motion-specwrap.gemspec
41
- has_rdoc: true
42
30
  homepage: https://github.com/mdks/motion-specwrap
43
31
  licenses: []
44
-
32
+ metadata: {}
45
33
  post_install_message:
46
34
  rdoc_options: []
47
-
48
- require_paths:
35
+ require_paths:
49
36
  - lib
50
- required_ruby_version: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- segments:
55
- - 0
56
- version: "0"
57
- required_rubygems_version: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- segments:
62
- - 0
63
- version: "0"
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
64
47
  requirements: []
65
-
66
48
  rubyforge_project:
67
- rubygems_version: 1.3.6
49
+ rubygems_version: 2.0.3
68
50
  signing_key:
69
- specification_version: 3
51
+ specification_version: 4
70
52
  summary: Exit value support wrapper for RubyMotion's 'rake spec'
71
53
  test_files: []
72
-
@@ -1,12 +0,0 @@
1
- module Motion
2
- module Project
3
- class Config
4
- alias :specwrap_original_spec_files :spec_files
5
- def spec_files
6
- [
7
- File.expand_path(File.dirname(__FILE__) + '/spec_setup.rb')
8
- ] + specwrap_original_spec_files
9
- end
10
- end
11
- end
12
- end
@@ -1,16 +0,0 @@
1
- module Bacon
2
- def self.context_did_finish(context)
3
- handle_specification_end
4
- Counter[:context_depth] -= 1
5
- if (@current_context_index + 1) < @contexts.size
6
- @current_context_index += 1
7
- run
8
- else
9
- # DONE
10
- handle_summary
11
- status_code = Counter.values_at(:failed, :errors).inject(:+)
12
- puts "Specwrap captured exit status code: #{status_code}"
13
- exit(status_code)
14
- end
15
- end
16
- end