fix 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/VERSION.semver +1 -1
  5. data/fix.gemspec +2 -2
  6. data/lib/fix.rb +7 -6
  7. data/lib/fix/db.rb +9 -7
  8. data/lib/fix/dsl.rb +2 -2
  9. data/lib/fix/subject.rb +1 -1
  10. data/lib/fix/test.rb +49 -40
  11. data/spec/fix/bin/color_spec.rb +17 -0
  12. data/spec/fix/bin/exit_status_spec.rb +19 -0
  13. data/spec/fix/bin/help_spec.rb +12 -0
  14. data/spec/fix/bin/spec_helper.rb +3 -0
  15. data/spec/fix/bin/version_spec.rb +9 -0
  16. data/spec/fix/lib/may/error_spec.rb +9 -0
  17. data/spec/fix/lib/may/info_spec.rb +9 -0
  18. data/spec/fix/lib/may/spec_helper.rb +1 -0
  19. data/spec/fix/lib/may/success_spec.rb +9 -0
  20. data/spec/fix/lib/must/error_spec.rb +9 -0
  21. data/spec/fix/lib/must/failure_spec.rb +9 -0
  22. data/spec/fix/lib/must/spec_helper.rb +1 -0
  23. data/spec/fix/lib/must/success_spec.rb +9 -0
  24. data/spec/fix/lib/should/error_spec.rb +9 -0
  25. data/spec/fix/lib/should/info_spec.rb +9 -0
  26. data/spec/fix/lib/should/spec_helper.rb +1 -0
  27. data/spec/fix/lib/should/success_spec.rb +9 -0
  28. data/spec/fix/lib/spec_helper.rb +1 -0
  29. data/spec/fix/lib/success_spec.rb +9 -0
  30. data/spec/fix/spec_helper.rb +1 -0
  31. data/spec/spec_helper.rb +1 -0
  32. data/spec/support/env.rb +1 -4
  33. data/spec/support/examples/42/app.rb +1 -0
  34. data/spec/support/examples/42/may/error/spec.rb +11 -0
  35. data/spec/support/examples/42/may/error/test.rb +7 -0
  36. data/spec/support/examples/42/may/info/spec.rb +11 -0
  37. data/spec/support/examples/42/may/info/test.rb +7 -0
  38. data/spec/support/examples/42/may/success/spec.rb +8 -0
  39. data/spec/support/examples/42/may/success/test.rb +7 -0
  40. data/spec/support/examples/42/must/error/spec.rb +7 -0
  41. data/spec/support/examples/42/must/error/test.rb +7 -0
  42. data/spec/support/examples/42/must/failure/spec.rb +7 -0
  43. data/spec/support/examples/42/must/failure/test.rb +7 -0
  44. data/spec/support/examples/42/must/success/spec.rb +7 -0
  45. data/spec/support/examples/42/must/success/test.rb +7 -0
  46. data/spec/support/examples/42/should/error/spec.rb +7 -0
  47. data/spec/support/examples/42/should/error/test.rb +7 -0
  48. data/spec/support/examples/42/should/info/spec.rb +7 -0
  49. data/spec/support/examples/42/should/info/test.rb +7 -0
  50. data/spec/support/examples/42/should/success/spec.rb +7 -0
  51. data/spec/support/examples/42/should/success/test.rb +7 -0
  52. data/{example/duck/lib.rb → spec/support/examples/duck/app.rb} +2 -0
  53. data/spec/support/examples/duck/success/spec.rb +33 -0
  54. data/spec/support/examples/duck/success/test.rb +7 -0
  55. metadata +88 -12
  56. metadata.gz.sig +0 -0
  57. data/example/duck/README.md +0 -8
  58. data/example/duck/app.rb +0 -3
  59. data/example/duck/test.rb +0 -36
  60. data/spec/TODO +0 -0
  61. data/spec/support/presenter.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1964b909221b9e975cd2bbaf03ebfe3fbe748fb1
4
- data.tar.gz: bedaf49f6b9f171ad4abb82817d391b97beafabc
3
+ metadata.gz: a60b163dcfc45938625b447954255573f72bf830
4
+ data.tar.gz: 9fe9f4a65edadfd535d84431917a9214afa4a285
5
5
  SHA512:
6
- metadata.gz: fc69cd9da13b6e207270601c1f71a9d489473991edbaa077901cc60a9faec0b53d31db95c57d3174f5f57b8610a4dee551a00ab148a290a2aeb37652c85a9013
7
- data.tar.gz: fc477c8a857a294bb3a31413f64147b427c5ea7eeb6d53c69f4da37223a012f3339dd4b21bddf3716f15a08185ef02fbfe0dea73ade0b1b1570953a6e85cbd9c
6
+ metadata.gz: 187e7ea75c9fc59c78c58109db558b70b1fb9c1344629f4735a04fe8fdcb2094a30b52daa73068ddaa96dd390eb6a9f0c687e64bfed80e118ce693718574ff5e
7
+ data.tar.gz: 9c7c0e1d345f02619aee188b52cce2a2ea22b078fc2c27da88c51a80c986f83fcd8885234cd00ea091031805ac5e7d8f81a1e8136ed8b8d2ade53b98c72f1ed6
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.6.0
@@ -14,14 +14,14 @@ Gem::Specification.new do |spec|
14
14
  spec.require_paths = ['lib']
15
15
  spec.required_ruby_version = '>= 2.0.0'
16
16
 
17
- spec.add_dependency 'spectus', '~> 1.0.0'
17
+ spec.add_dependency 'spectus', '~> 1.0.1'
18
18
 
19
19
  spec.add_development_dependency 'bundler', '~> 1.7'
20
20
  spec.add_development_dependency 'rake', '~> 10.0'
21
21
  spec.add_development_dependency 'yard', '~> 0.8'
22
22
  spec.add_development_dependency 'coveralls', '~> 0.7'
23
23
 
24
- private_key = File.expand_path '~/.gemcert/fix-gem-private_key.pem'
24
+ private_key = File.expand_path File.join('~', '.gemcert', 'fix-gem-private_key.pem')
25
25
  if File.exist? private_key
26
26
  spec.signing_key = private_key
27
27
  spec.cert_chain = ['fix.pem']
data/lib/fix.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require_relative File.join 'fix', 'dsl'
1
2
  require_relative File.join 'fix', 'version'
2
3
 
3
4
  require 'optparse'
@@ -36,26 +37,26 @@ module Fix
36
37
  opts.separator ''
37
38
  opts.separator 'Specific options:'
38
39
 
39
- opts.on('-c', '--color', 'Enable color in the output.') do
40
+ opts.on('--color', 'Enable color in the output.') do
40
41
  options[:color] = (const_set :COLOR, true)
41
42
  end
42
43
 
43
- opts.on('-s [INTEGER]', '--seed [INTEGER]', Integer, 'Order of the tests') do |seed|
44
+ opts.on('--seed [INTEGER]', Integer, 'Order of the tests') do |seed|
44
45
  options[:seed] = seed
45
46
  end
46
47
 
47
- opts.on('-d', '--debug', 'Enable ruby debug') do
48
+ opts.on('--debug', 'Enable ruby debug') do
48
49
  options[:debug] = $DEBUG = true
49
50
  end
50
51
 
51
- opts.on('-w', '--warnings', 'Enable ruby warnings') do
52
+ opts.on('--warnings', 'Enable ruby warnings') do
52
53
  options[:warnings] = $VERBOSE = true
53
54
  end
54
55
 
55
56
  opts.separator ''
56
57
  opts.separator 'Common options:'
57
58
 
58
- opts.on_tail '-h', '--help', 'Show this message' do
59
+ opts.on_tail '--help', 'Show this message' do
59
60
  puts opts
60
61
  exit
61
62
  end
@@ -75,7 +76,7 @@ module Fix
75
76
  absolute_paths = Set.new
76
77
 
77
78
  args.map do |s|
78
- s = File.absolute_path s unless s.start_with? '/'
79
+ s = File.absolute_path s unless s.start_with? File::SEPARATOR
79
80
 
80
81
  if File.directory? s
81
82
  spec_files = File.join s, '**', '*_spec.rb'
@@ -1,15 +1,17 @@
1
1
  require 'singleton'
2
2
 
3
3
  module Fix
4
- random = Random.new(defined?(SEED) ? SEED : Random.new_seed)
4
+ unless defined? DB
5
+ random = Random.new(defined?(SEED) ? SEED : Random.new_seed)
5
6
 
6
- db = Class.new Hash do
7
- include Singleton
7
+ db = Class.new Hash do
8
+ include Singleton
8
9
 
9
- define_method :random do
10
- random
10
+ define_method :random do
11
+ random
12
+ end
11
13
  end
12
- end
13
14
 
14
- const_set :DB, db
15
+ const_set :DB, db
16
+ end
15
17
  end
@@ -12,6 +12,6 @@ module Fix
12
12
  @object = object
13
13
  end
14
14
 
15
- at_exit { Test.new if $!.nil? }
16
- end
15
+ at_exit { Test.new if $!.nil? && DB.instance.any? }
16
+ end unless defined? DSL
17
17
  end
@@ -5,7 +5,7 @@ module Fix
5
5
  def initialize input, *args
6
6
  @args = args
7
7
  @error = nil
8
- @implemented = nil
8
+ @implemented = true
9
9
  @last_arg = -1
10
10
 
11
11
  begin
@@ -34,10 +34,12 @@ module Fix
34
34
  end
35
35
 
36
36
  @io.puts
37
- @io.puts about "Finished in #{@total_time} seconds."
37
+ @io.puts about "Ran #{@results.length} tests in #{@total_time} seconds"
38
38
  @io.puts statistics
39
39
 
40
40
  freeze
41
+
42
+ exit 1 if fail?
41
43
  end
42
44
 
43
45
  def errors
@@ -54,50 +56,50 @@ module Fix
54
56
 
55
57
  def reports results_with_state
56
58
  __send__(results_with_state).map do |result|
57
- result.fetch(:object).inspect +
58
- if result.fetch(:params).any?
59
- '.' +
60
- result.fetch(:params).map.with_index do |args, i|
61
- color = if i == result.fetch(:last_arg)
62
- state result
63
- elsif i > result.fetch(:last_arg)
64
- :pending
65
- else
66
- :default
67
- end
68
-
69
- __send__(color, "#{args.first}" +
70
- if args.length > 1
71
- '(' + args[1..-1].map {|arg| arg.to_s }.join(',') + ')'
72
- else
73
- ''
74
- end
75
- )
76
- end.join('.')
77
- else
78
- ''
79
- end +
59
+ truncate(result.fetch(:object).inspect) +
60
+ if result.fetch(:params).any?
80
61
  '.' +
81
- (
82
- color = if result.fetch(:params).length == result.fetch(:last_arg)
62
+ result.fetch(:params).map.with_index do |args, i|
63
+ color = if i == result.fetch(:last_arg)
83
64
  state result
84
- else
65
+ elsif i > result.fetch(:last_arg)
85
66
  :pending
67
+ else
68
+ :default
86
69
  end
87
70
 
88
- __send__(color, "#{result.fetch(:challenge).first}" +
89
- if result.fetch(:challenge).length > 1
90
- '(' + result.fetch(:challenge)[1..-1].map {|arg| arg.to_s }.join(',') + ')'
71
+ __send__(color, "#{args.first}" +
72
+ if args.length > 1
73
+ '(' + args[1..-1].map {|arg| arg.to_s }.join(',') + ')'
91
74
  else
92
75
  ''
93
76
  end
94
77
  )
95
- ) +
96
- ' ' +
97
- expectation_level(result) +
98
- ' ' +
99
- matcher_with_expected_if_given(result) +
100
- returned_value(result)
78
+ end.join('.')
79
+ else
80
+ ''
81
+ end +
82
+ '.' +
83
+ (
84
+ color = if result.fetch(:params).length == result.fetch(:last_arg)
85
+ state result
86
+ else
87
+ :pending
88
+ end
89
+
90
+ __send__(color, "#{result.fetch(:challenge).first}" +
91
+ if result.fetch(:challenge).length > 1
92
+ '(' + result.fetch(:challenge)[1..-1].map {|arg| arg.inspect }.join(',') + ')'
93
+ else
94
+ ''
95
+ end
96
+ )
97
+ ) +
98
+ ' ' +
99
+ expectation_level(result) +
100
+ ' ' +
101
+ matcher_with_expected_if_given(result) +
102
+ returned_value(result)
101
103
  end
102
104
  end
103
105
 
@@ -110,14 +112,17 @@ module Fix
110
112
  :success
111
113
  end
112
114
 
113
- percents = (@results.count {|result| result.fetch(:pass) != false }) / @results.length.to_f * 100
115
+ percents = if @results.empty?
116
+ 100
117
+ else
118
+ (@results.count {|result| result.fetch(:pass) != false }) / @results.length.to_f * 100
119
+ end
114
120
 
115
- __send__ color, "#{percents.round}% compliant (" + [
116
- "#{@results.length} specs",
121
+ __send__ color, "#{percents.round}% compliant - " + [
117
122
  "#{infos.length} infos",
118
123
  "#{failures.length} failures",
119
124
  "#{errors.length} errors"
120
- ].join(', ') + ')'
125
+ ].join(', ')
121
126
  end
122
127
 
123
128
  def pass?
@@ -130,6 +135,10 @@ module Fix
130
135
 
131
136
  private
132
137
 
138
+ def truncate string
139
+ string.length > 16 ? string[0..16].concat('[...]') : string
140
+ end
141
+
133
142
  def returned_value result
134
143
  if result.fetch(:exception).nil?
135
144
  about ' # => got ' + result.fetch(:got).inspect
@@ -0,0 +1,17 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject Proc.new {
4
+ `#{BIN_PATH} #{Pathname.new(__FILE__).join '..', '..', '..', 'support', 'examples', 'duck', 'success', 'test.rb'}`
5
+ }
6
+
7
+ its :call do
8
+ MUST match: /^......$/
9
+ end
10
+
11
+ subject Proc.new {
12
+ `#{BIN_PATH} #{Pathname.new(__FILE__).join '..', '..', '..', 'support', 'examples', 'duck', 'success', 'test.rb'} --color`
13
+ }
14
+
15
+ its :call do
16
+ MUST match: /^#{Regexp.escape("\e[32m.\e[0m" * 6)}$/
17
+ end
@@ -0,0 +1,19 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject Proc.new {
4
+ `#{BIN_PATH} #{Pathname.new(__FILE__).join '..', '..', '..', 'support', 'examples', '42', 'must', 'success', 'test.rb'}`
5
+ $?
6
+ }
7
+
8
+ on :call do
9
+ its(:exitstatus) { MUST equal: 0 }
10
+ end
11
+
12
+ subject Proc.new {
13
+ `#{BIN_PATH} #{Pathname.new(__FILE__).join '..', '..', '..', 'support', 'examples', '42', 'must', 'error', 'test.rb'}`
14
+ $?
15
+ }
16
+
17
+ on :call do
18
+ its(:exitstatus) { MUST equal: 1 }
19
+ end
@@ -0,0 +1,12 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject Proc.new { `#{BIN_PATH} --help` }
4
+
5
+ its :call do
6
+ MUST match: /Usage: fix <files or directories> \[options\]/
7
+ MUST match: / --color /
8
+ MUST match: / --seed /
9
+ MUST match: / --debug /
10
+ MUST match: / --warnings /
11
+ MUST match: / --version /
12
+ end
@@ -0,0 +1,3 @@
1
+ require_relative File.join '..', 'spec_helper'
2
+
3
+ BIN_PATH = Pathname.new(__FILE__).join '..', '..', '..', '..', 'bin', 'fix'
@@ -0,0 +1,9 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject Proc.new { `#{BIN_PATH} --version` }
4
+
5
+ its :call do
6
+ MUST eql: File.open(
7
+ Pathname.new(__FILE__).join '..', '..', '..', '..', 'VERSION.semver'
8
+ ).read
9
+ end
@@ -0,0 +1,9 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject -> {
4
+ `ruby #{File.join File.dirname(__FILE__), '..', '..', '..', 'support', 'examples', '42', 'may', 'error', 'test.rb'}`
5
+ }
6
+
7
+ its :call do
8
+ MUST match: /^0% compliant - 0 infos, 0 failures, 2 errors$/
9
+ end
@@ -0,0 +1,9 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject -> {
4
+ `ruby #{File.join File.dirname(__FILE__), '..', '..', '..', 'support', 'examples', '42', 'may', 'info', 'test.rb'}`
5
+ }
6
+
7
+ its :call do
8
+ MUST match: /^100% compliant - 2 infos, 0 failures, 0 errors$/
9
+ end
@@ -0,0 +1 @@
1
+ require_relative File.join '..', 'spec_helper'
@@ -0,0 +1,9 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject -> {
4
+ `ruby #{File.join File.dirname(__FILE__), '..', '..', '..', 'support', 'examples', '42', 'may', 'success', 'test.rb'}`
5
+ }
6
+
7
+ its :call do
8
+ MUST match: /^100% compliant - 0 infos, 0 failures, 0 errors$/
9
+ end
@@ -0,0 +1,9 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject -> {
4
+ `ruby #{File.join File.dirname(__FILE__), '..', '..', '..', 'support', 'examples', '42', 'must', 'error', 'test.rb'}`
5
+ }
6
+
7
+ its :call do
8
+ MUST match: /^0% compliant - 0 infos, 0 failures, 1 errors$/
9
+ end
@@ -0,0 +1,9 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject -> {
4
+ `ruby #{File.join File.dirname(__FILE__), '..', '..', '..', 'support', 'examples', '42', 'must', 'failure', 'test.rb'}`
5
+ }
6
+
7
+ its :call do
8
+ MUST match: /^0% compliant - 0 infos, 1 failures, 0 errors$/
9
+ end
@@ -0,0 +1 @@
1
+ require_relative File.join '..', 'spec_helper'
@@ -0,0 +1,9 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject -> {
4
+ `ruby #{File.join File.dirname(__FILE__), '..', '..', '..', 'support', 'examples', '42', 'must', 'success', 'test.rb'}`
5
+ }
6
+
7
+ its :call do
8
+ MUST match: /^100% compliant - 0 infos, 0 failures, 0 errors$/
9
+ end
@@ -0,0 +1,9 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject -> {
4
+ `ruby #{File.join File.dirname(__FILE__), '..', '..', '..', 'support', 'examples', '42', 'should', 'error', 'test.rb'}`
5
+ }
6
+
7
+ its :call do
8
+ MUST match: /^0% compliant - 0 infos, 0 failures, 1 errors$/
9
+ end
@@ -0,0 +1,9 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject -> {
4
+ `ruby #{File.join File.dirname(__FILE__), '..', '..', '..', 'support', 'examples', '42', 'should', 'info', 'test.rb'}`
5
+ }
6
+
7
+ its :call do
8
+ MUST match: /^100% compliant - 1 infos, 0 failures, 0 errors$/
9
+ end
@@ -0,0 +1 @@
1
+ require_relative File.join '..', 'spec_helper'
@@ -0,0 +1,9 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject -> {
4
+ `ruby #{File.join File.dirname(__FILE__), '..', '..', '..', 'support', 'examples', '42', 'should', 'success', 'test.rb'}`
5
+ }
6
+
7
+ its :call do
8
+ MUST match: /^100% compliant - 0 infos, 0 failures, 0 errors$/
9
+ end
@@ -0,0 +1 @@
1
+ require_relative File.join '..', 'spec_helper'
@@ -0,0 +1,9 @@
1
+ require_relative 'spec_helper'
2
+
3
+ subject -> {
4
+ `ruby #{File.join File.dirname(__FILE__), '..', '..', 'support', 'examples', 'duck', 'success', 'test.rb'}`
5
+ }
6
+
7
+ its :call do
8
+ MUST match: /^100% compliant - 0 infos, 0 failures, 0 errors$/
9
+ end
@@ -0,0 +1 @@
1
+ require_relative File.join '..', 'spec_helper'
@@ -1,3 +1,4 @@
1
1
  require_relative 'support'
2
2
 
3
3
  require_relative File.join '..', 'lib', 'fix'
4
+ extend Fix::DSL
@@ -1,4 +1 @@
1
- if RUBY_VERSION < '2.0.0'
2
- warn "Needs Ruby 2.0.0, you're running: #{RUBY_VERSION}"
3
- exit 1
4
- end
1
+ abort "Needs Ruby 2, you're running: #{RUBY_VERSION}" if RUBY_VERSION < '2'
@@ -0,0 +1 @@
1
+ @app = 42
@@ -0,0 +1,11 @@
1
+ @specs = ->(front_object) {
2
+ extend Fix::DSL
3
+
4
+ subject front_object
5
+
6
+ its(:/, 0) { MAY equal: 4 }
7
+
8
+ on :/, 0 do
9
+ it { MAY equal: 4 }
10
+ end
11
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ require_relative File.join '..', '..', 'app'
4
+ require_relative File.join '..', '..', '..', '..', '..', '..', 'lib', 'fix', 'dsl'
5
+ require_relative 'spec'
6
+
7
+ @specs.call @app
@@ -0,0 +1,11 @@
1
+ @specs = ->(front_object) {
2
+ extend Fix::DSL
3
+
4
+ subject front_object
5
+
6
+ its(:to_i) { MAY equal: 4 }
7
+
8
+ on :to_i do
9
+ it { MAY equal: 4 }
10
+ end
11
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ require_relative File.join '..', '..', 'app'
4
+ require_relative File.join '..', '..', '..', '..', '..', '..', 'lib', 'fix', 'dsl'
5
+ require_relative 'spec'
6
+
7
+ @specs.call @app
@@ -0,0 +1,8 @@
1
+ @specs = ->(front_object) {
2
+ extend Fix::DSL
3
+
4
+ subject front_object
5
+
6
+ its(:to_i) { MAY equal: 42 }
7
+ its(:foo) { MAY equal: 42 }
8
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ require_relative File.join '..', '..', 'app'
4
+ require_relative File.join '..', '..', '..', '..', '..', '..', 'lib', 'fix', 'dsl'
5
+ require_relative 'spec'
6
+
7
+ @specs.call @app
@@ -0,0 +1,7 @@
1
+ @specs = ->(front_object) {
2
+ extend Fix::DSL
3
+
4
+ subject front_object
5
+
6
+ its(:foo) { MUST equal: 4 }
7
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ require_relative File.join '..', '..', 'app'
4
+ require_relative File.join '..', '..', '..', '..', '..', '..', 'lib', 'fix', 'dsl'
5
+ require_relative 'spec'
6
+
7
+ @specs.call @app
@@ -0,0 +1,7 @@
1
+ @specs = ->(front_object) {
2
+ extend Fix::DSL
3
+
4
+ subject front_object
5
+
6
+ its(:to_i) { MUST equal: 4 }
7
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ require_relative File.join '..', '..', 'app'
4
+ require_relative File.join '..', '..', '..', '..', '..', '..', 'lib', 'fix', 'dsl'
5
+ require_relative 'spec'
6
+
7
+ @specs.call @app
@@ -0,0 +1,7 @@
1
+ @specs = ->(front_object) {
2
+ extend Fix::DSL
3
+
4
+ subject front_object
5
+
6
+ its(:to_i) { MUST equal: 42 }
7
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ require_relative File.join '..', '..', 'app'
4
+ require_relative File.join '..', '..', '..', '..', '..', '..', 'lib', 'fix', 'dsl'
5
+ require_relative 'spec'
6
+
7
+ @specs.call @app
@@ -0,0 +1,7 @@
1
+ @specs = ->(front_object) {
2
+ extend Fix::DSL
3
+
4
+ subject front_object
5
+
6
+ its(:foo) { SHOULD equal: 4 }
7
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ require_relative File.join '..', '..', 'app'
4
+ require_relative File.join '..', '..', '..', '..', '..', '..', 'lib', 'fix', 'dsl'
5
+ require_relative 'spec'
6
+
7
+ @specs.call @app
@@ -0,0 +1,7 @@
1
+ @specs = ->(front_object) {
2
+ extend Fix::DSL
3
+
4
+ subject front_object
5
+
6
+ its(:to_i) { SHOULD equal: 4 }
7
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ require_relative File.join '..', '..', 'app'
4
+ require_relative File.join '..', '..', '..', '..', '..', '..', 'lib', 'fix', 'dsl'
5
+ require_relative 'spec'
6
+
7
+ @specs.call @app
@@ -0,0 +1,7 @@
1
+ @specs = ->(front_object) {
2
+ extend Fix::DSL
3
+
4
+ subject front_object
5
+
6
+ its(:to_i) { SHOULD equal: 42 }
7
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ require_relative File.join '..', '..', 'app'
4
+ require_relative File.join '..', '..', '..', '..', '..', '..', 'lib', 'fix', 'dsl'
5
+ require_relative 'spec'
6
+
7
+ @specs.call @app
@@ -12,3 +12,5 @@ class Duck
12
12
  puts "Quaaaaaack!"
13
13
  end
14
14
  end
15
+
16
+ @app = Duck.new
@@ -0,0 +1,33 @@
1
+ @specs = ->(front_object) {
2
+ extend Fix::DSL
3
+
4
+ subject front_object
5
+
6
+ let(:word) { "Quaaa" }
7
+
8
+ on :swims do
9
+ it { MUST capture_stderr: " ...\n" }
10
+ end
11
+
12
+ on :quacks do
13
+ let(:quaaaaaack) { word + "aaack!\n" }
14
+
15
+ it { SHOULD capture_stdout: quaaaaaack }
16
+ end
17
+
18
+ its(:speaks) { MUST raise_exception: NoMethodError }
19
+
20
+ on :sings do
21
+ it { MAY eql: "♪... ♫..." }
22
+ end
23
+
24
+ on :walks do
25
+ let(:walks) { "#{word}... Klop klop!" }
26
+
27
+ it { MUST eql: walks }
28
+
29
+ on :split, '... ' do
30
+ its(:last) { MUST eql: "Klop klop!" }
31
+ end
32
+ end
33
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ require_relative File.join '..', 'app'
4
+ require_relative File.join '..', '..', '..', '..', '..', 'lib', 'fix', 'dsl'
5
+ require_relative 'spec'
6
+
7
+ @specs.call @app
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Wack
@@ -30,7 +30,7 @@ cert_chain:
30
30
  sQCgS9KCAyZ+aWNO1bUJcE3Bx1XXkMO3JEyVR1CoEcexg5Ci03/lAm7lL84DmlKR
31
31
  3I7UWtomapPFbzC0J/5jzQ==
32
32
  -----END CERTIFICATE-----
33
- date: 2014-10-05 00:00:00.000000000 Z
33
+ date: 2014-10-14 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: spectus
@@ -38,14 +38,14 @@ dependencies:
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 1.0.0
41
+ version: 1.0.1
42
42
  type: :runtime
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 1.0.0
48
+ version: 1.0.1
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: bundler
51
51
  requirement: !ruby/object:Gem::Requirement
@@ -119,10 +119,6 @@ files:
119
119
  - Rakefile
120
120
  - VERSION.semver
121
121
  - bin/fix
122
- - example/duck/README.md
123
- - example/duck/app.rb
124
- - example/duck/lib.rb
125
- - example/duck/test.rb
126
122
  - fix.gemspec
127
123
  - fix.pem
128
124
  - lib/fix.rb
@@ -145,12 +141,52 @@ files:
145
141
  - lib/fix/subject.rb
146
142
  - lib/fix/test.rb
147
143
  - lib/fix/version.rb
148
- - spec/TODO
144
+ - spec/fix/bin/color_spec.rb
145
+ - spec/fix/bin/exit_status_spec.rb
146
+ - spec/fix/bin/help_spec.rb
147
+ - spec/fix/bin/spec_helper.rb
148
+ - spec/fix/bin/version_spec.rb
149
+ - spec/fix/lib/may/error_spec.rb
150
+ - spec/fix/lib/may/info_spec.rb
151
+ - spec/fix/lib/may/spec_helper.rb
152
+ - spec/fix/lib/may/success_spec.rb
153
+ - spec/fix/lib/must/error_spec.rb
154
+ - spec/fix/lib/must/failure_spec.rb
155
+ - spec/fix/lib/must/spec_helper.rb
156
+ - spec/fix/lib/must/success_spec.rb
157
+ - spec/fix/lib/should/error_spec.rb
158
+ - spec/fix/lib/should/info_spec.rb
159
+ - spec/fix/lib/should/spec_helper.rb
160
+ - spec/fix/lib/should/success_spec.rb
161
+ - spec/fix/lib/spec_helper.rb
162
+ - spec/fix/lib/success_spec.rb
163
+ - spec/fix/spec_helper.rb
149
164
  - spec/spec_helper.rb
150
165
  - spec/support.rb
151
166
  - spec/support/coverage.rb
152
167
  - spec/support/env.rb
153
- - spec/support/presenter.rb
168
+ - spec/support/examples/42/app.rb
169
+ - spec/support/examples/42/may/error/spec.rb
170
+ - spec/support/examples/42/may/error/test.rb
171
+ - spec/support/examples/42/may/info/spec.rb
172
+ - spec/support/examples/42/may/info/test.rb
173
+ - spec/support/examples/42/may/success/spec.rb
174
+ - spec/support/examples/42/may/success/test.rb
175
+ - spec/support/examples/42/must/error/spec.rb
176
+ - spec/support/examples/42/must/error/test.rb
177
+ - spec/support/examples/42/must/failure/spec.rb
178
+ - spec/support/examples/42/must/failure/test.rb
179
+ - spec/support/examples/42/must/success/spec.rb
180
+ - spec/support/examples/42/must/success/test.rb
181
+ - spec/support/examples/42/should/error/spec.rb
182
+ - spec/support/examples/42/should/error/test.rb
183
+ - spec/support/examples/42/should/info/spec.rb
184
+ - spec/support/examples/42/should/info/test.rb
185
+ - spec/support/examples/42/should/success/spec.rb
186
+ - spec/support/examples/42/should/success/test.rb
187
+ - spec/support/examples/duck/app.rb
188
+ - spec/support/examples/duck/success/spec.rb
189
+ - spec/support/examples/duck/success/test.rb
154
190
  homepage: http://fixrb.org/
155
191
  licenses:
156
192
  - MIT
@@ -176,10 +212,50 @@ signing_key:
176
212
  specification_version: 4
177
213
  summary: Specing framework.
178
214
  test_files:
179
- - spec/TODO
215
+ - spec/fix/bin/color_spec.rb
216
+ - spec/fix/bin/exit_status_spec.rb
217
+ - spec/fix/bin/help_spec.rb
218
+ - spec/fix/bin/spec_helper.rb
219
+ - spec/fix/bin/version_spec.rb
220
+ - spec/fix/lib/may/error_spec.rb
221
+ - spec/fix/lib/may/info_spec.rb
222
+ - spec/fix/lib/may/spec_helper.rb
223
+ - spec/fix/lib/may/success_spec.rb
224
+ - spec/fix/lib/must/error_spec.rb
225
+ - spec/fix/lib/must/failure_spec.rb
226
+ - spec/fix/lib/must/spec_helper.rb
227
+ - spec/fix/lib/must/success_spec.rb
228
+ - spec/fix/lib/should/error_spec.rb
229
+ - spec/fix/lib/should/info_spec.rb
230
+ - spec/fix/lib/should/spec_helper.rb
231
+ - spec/fix/lib/should/success_spec.rb
232
+ - spec/fix/lib/spec_helper.rb
233
+ - spec/fix/lib/success_spec.rb
234
+ - spec/fix/spec_helper.rb
180
235
  - spec/spec_helper.rb
181
236
  - spec/support.rb
182
237
  - spec/support/coverage.rb
183
238
  - spec/support/env.rb
184
- - spec/support/presenter.rb
239
+ - spec/support/examples/42/app.rb
240
+ - spec/support/examples/42/may/error/spec.rb
241
+ - spec/support/examples/42/may/error/test.rb
242
+ - spec/support/examples/42/may/info/spec.rb
243
+ - spec/support/examples/42/may/info/test.rb
244
+ - spec/support/examples/42/may/success/spec.rb
245
+ - spec/support/examples/42/may/success/test.rb
246
+ - spec/support/examples/42/must/error/spec.rb
247
+ - spec/support/examples/42/must/error/test.rb
248
+ - spec/support/examples/42/must/failure/spec.rb
249
+ - spec/support/examples/42/must/failure/test.rb
250
+ - spec/support/examples/42/must/success/spec.rb
251
+ - spec/support/examples/42/must/success/test.rb
252
+ - spec/support/examples/42/should/error/spec.rb
253
+ - spec/support/examples/42/should/error/test.rb
254
+ - spec/support/examples/42/should/info/spec.rb
255
+ - spec/support/examples/42/should/info/test.rb
256
+ - spec/support/examples/42/should/success/spec.rb
257
+ - spec/support/examples/42/should/success/test.rb
258
+ - spec/support/examples/duck/app.rb
259
+ - spec/support/examples/duck/success/spec.rb
260
+ - spec/support/examples/duck/success/test.rb
185
261
  has_rdoc:
metadata.gz.sig CHANGED
Binary file
@@ -1,8 +0,0 @@
1
- # Duck example
2
-
3
- ```bash
4
- $ ./test.rb
5
- ......
6
- Finished in 0.001181 seconds.
7
- 100% compliant (6 specs, 0 infos, 0 failures, 0 errors)
8
- ```
@@ -1,3 +0,0 @@
1
- require_relative 'lib'
2
-
3
- @app = Duck.new
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env ruby -w
2
-
3
- require_relative 'app'
4
- require_relative File.join '..', '..', 'lib', 'fix', 'dsl'
5
-
6
- extend Fix::DSL
7
-
8
- subject @app
9
-
10
- let(:word) { "Quaaa" }
11
-
12
- on :swims do
13
- it { MUST capture_stderr: " ...\n" }
14
- end
15
-
16
- on :quacks do
17
- let(:quaaaaaack) { word + "aaack!\n" }
18
-
19
- it { SHOULD capture_stdout: quaaaaaack }
20
- end
21
-
22
- its(:speaks) { MUST raise_exception: NoMethodError }
23
-
24
- on :sings do
25
- it { MAY eql: "♪... ♫..." }
26
- end
27
-
28
- on :walks do
29
- let(:walks) { "#{word}... Klop klop!" }
30
-
31
- it { MUST eql: walks }
32
-
33
- on :split, '... ' do
34
- its(:last) { MUST eql: "Klop klop!" }
35
- end
36
- end
data/spec/TODO DELETED
File without changes
File without changes