shindo 0.3.9 → 0.3.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e242a66a1e32f046b9679b17b4bfc81e6c96acca406c59a142a315192f18f91
4
- data.tar.gz: 1b24e9ce0a145f077b3e30eb2bc2b6e6ea5f76a855adec26ebde472f9c139db3
3
+ metadata.gz: 0e14ff3e7068eef88b7cc53cd51132d6bafcbbef3fa3bdd46c65ef679f47fc50
4
+ data.tar.gz: 5a0262b11d3ae34ac5009ecb30a06d4179806824b790a71dfc134b93adc876da
5
5
  SHA512:
6
- metadata.gz: cfcc6bc96a24b0f0a986b53a587c27a1dbe391531206206ad29a908185e616f54f374b22970f1876becebc39a6365dba82c06e01bd380eac04a24959cc8f45dd
7
- data.tar.gz: 8da45cf108ab6a42195f01d5d7b272c4bd9070bd177662ec8ef557c1f7bf24c68abde37fda0a3b14184a8249badc20f9ad3074403d0f196d94e43f5d6da67f20
6
+ metadata.gz: 675612ee62ec7523a4ac2227d6a7ead5b30836f6dafc25183914e64cfc9694906860f79b84dfe8c45fe6a1f053487909918b5871b4ff91b7e15565708df1b2b5
7
+ data.tar.gz: 0f77812ee56fa9af995bcf6978716f970b612fc15a4fa2bf1f76ab263b8a51fdc797c4e1535a9ad5b4c22d11daabc34914771bd2af7cd224ab69f5e57cc5aa78
data/README.rdoc CHANGED
@@ -27,31 +27,28 @@ For one off simple tests like this you can also chain the calls like this:
27
27
 
28
28
  You can also override the default descriptions:
29
29
 
30
- Shindo.tests('foo/bar') do
31
- returns('foo', 'returns foo when bar') { 'foo' }
32
- raises(StandardError, 'raises StandardError when baz') { raise StandardError }
30
+ Shindo.tests('example/bar') do
31
+ returns('default description', 'overriding description: non-default description') { 'default description' }
32
+ raises(StandardError, 'overriding description: raises when true') { raise StandardError if true }
33
33
  end
34
34
 
35
35
  Or nest things inside tests blocks:
36
36
  Shindo.tests do
37
- tests('returns') do
38
- returns('foo', 'returns foo when bar') { 'foo' }
39
- returns('bar', 'returns bar when baz') { 'bar' }
40
- end
41
- tests('raises') do
42
- raises(StandardError, 'raises StandardError when baz') { raise StandardError }
43
- raises(StandardError, 'raises StandardError when qux') { raise StandardError }
37
+ tests('examples') do
38
+ returns(true, 'returns true description') { true }
39
+ returns(false, 'returns false description') { false }
40
+ raises(StandardError, 'raises StandardError description') { raise StandardError }
44
41
  end
45
42
  end
46
43
 
47
- Then, if you want to get real fancy you can also tag your tests, to help narrow down which ones to run
44
+ Then, if you want to get extra fancy you can tag tests, to help narrow down which ones to run
48
45
 
49
- Shindo.tests('tests for foo', 'foo') do
50
- test('foo') { true }
46
+ Shindo.tests('tests for true', 'true') do
47
+ test(true) { true }
51
48
  end
52
49
 
53
- Shindo.tests('tests for bar', 'bar') do
54
- test('bar') { true }
50
+ Shindo.tests('tests for false', 'false') do
51
+ test(false) { false }
55
52
  end
56
53
 
57
54
  Note: you'll have to supply a non-default description first, and then follow up with tags.
@@ -61,11 +58,11 @@ Note: you'll have to supply a non-default description first, and then follow up
61
58
  Tests get evaluated in the file just like you see it so you can add setup and teardown easily:
62
59
 
63
60
  Shindo.tests do
64
- foo = 'bar' # setup
65
- tests('foo').returns('bar') { foo }
61
+ bool = true # setup
62
+ tests('bool').returns(true) { bool }
66
63
 
67
- foo = 'baz' # cleanup after last
68
- tests('foo').returns('baz') { foo }
64
+ bool = false # cleanup after last
65
+ tests('bool').returns(false) { bool }
69
66
 
70
67
  foo = nil # teardown
71
68
  end
@@ -94,17 +91,17 @@ You can also give directories and it will run all files ending in _tests.rb and
94
91
 
95
92
  shindo some_test_directory
96
93
 
97
- That leaves tags, which use +/-. So run just tests with the 'foo' tag:
94
+ That leaves tags, which use +/-. So run just tests with the 'true' tag:
98
95
 
99
- shindo some_test_directory +foo
96
+ shindo some_test_directory +true
100
97
 
101
- Or those without the 'bar' tag:
98
+ Or those without the 'false' tag:
102
99
 
103
- shindo some_test_directory -bar
100
+ shindo some_test_directory -false
104
101
 
105
- Or combine to run everything with a foo tag, but no bar tag
102
+ Or combine to run everything with a 'true' tag, but no 'false' tag
106
103
 
107
- shindo some_test_directory +foo -bar
104
+ shindo some_test_directory +true -false
108
105
 
109
106
  If you are running in a non-interactive mode, or one where speed matters (i.e. continuous integration), you can run shindo with (n)o (t)race and much quieter output. It takes all the same arguments, but uses the shindont bin file.
110
107
 
@@ -118,7 +115,7 @@ When tests fail you'll get lots of options to help you debug the problem, just e
118
115
 
119
116
  (The MIT License)
120
117
 
121
- Copyright (c) 2009 {geemus (Wesley Beary)}[http://github.com/geemus]
118
+ Copyright (c) 2021 {geemus (Wesley Beary)}[http://github.com/geemus]
122
119
 
123
120
  Permission is hereby granted, free of charge, to any person obtaining
124
121
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -45,7 +45,7 @@ end
45
45
 
46
46
  require File.join(File.dirname(__FILE__), 'lib', 'shindo', 'rake')
47
47
  Shindo::Rake.new
48
- task :default => :shindo_tests
48
+ task :default => :tests
49
49
 
50
50
  desc "Generate RCov test coverage and open in your browser"
51
51
  task :coverage do
@@ -140,12 +140,3 @@ task :validate do
140
140
  exit!
141
141
  end
142
142
  end
143
-
144
- task :shindo_tests do
145
- system "shindo -build_error"
146
- fail "Tests excluding build error should pass" unless $? == 0
147
-
148
- puts "2"
149
- system "shindo +build_error"
150
- fail "The build_error test should fail" unless $? != 0
151
- end
data/lib/shindo/bin.rb CHANGED
@@ -29,7 +29,7 @@ for argument in ARGV
29
29
  if File.directory?(path)
30
30
  tests ||= []
31
31
  tests |= Dir.glob(File.join(path, '**', '*tests.rb'))
32
- elsif File.exists?(path)
32
+ elsif File.exist?(path)
33
33
  tests ||= []
34
34
  tests << path
35
35
  else
@@ -74,11 +74,11 @@ run_in_thread(helpers, tests, @thread_locals.merge({:tags => tags}))
74
74
  @totals ||= { :failed => 0, :errored => 0, :pending => 0, :succeeded => 0 }
75
75
  @success = @totals[:failed] + @totals[:errored] == 0
76
76
  status = []
77
- status << "[red]#{@totals[:failed]} failed[/]," if @totals[:failed] > 0
78
- status << "[red]#{@totals[:errored]} errored[/]," if @totals[:errored] > 0
79
- status << "[yellow]#{@totals[:pending]} pending[/]," if @totals[:pending] > 0
77
+ status << "[red]#{@totals[:failed]} failed[/]" if @totals[:failed] > 0
78
+ status << "[red]#{@totals[:errored]} errored[/]" if @totals[:errored] > 0
79
+ status << "[yellow]#{@totals[:pending]} pending[/]" if @totals[:pending] > 0
80
80
  status << "[green]#{@totals[:succeeded]} succeeded[/]"
81
- status = status[0...-2].join(', ') << ' and ' << status[-1] if status.length > 3
81
+ status = [status[0...-1].join(', '), 'and', status[-1]] if status.length >= 2
82
82
  status << "in [bold]#{Time.now - @started_at}[/] seconds"
83
83
  Formatador.display_lines(['', status.join(' '), ''])
84
84
 
data/lib/shindo/rake.rb CHANGED
@@ -7,7 +7,7 @@ module Shindo
7
7
  def initialize
8
8
  desc "Run shindo tests"
9
9
  task :tests do
10
- system 'shindo'
10
+ ruby '-S', 'shindo'
11
11
  fail if $? != 0
12
12
  end
13
13
  end
data/lib/shindo.rb CHANGED
@@ -5,7 +5,7 @@ module Shindo
5
5
  class Pending < StandardError; end
6
6
 
7
7
  unless const_defined?(:VERSION)
8
- VERSION = '0.3.9'
8
+ VERSION = '0.3.11'
9
9
  end
10
10
 
11
11
  def self.tests(description = nil, tags = [], &block)
data/shindo.gemspec CHANGED
@@ -13,9 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'shindo'
16
- s.version = '0.3.9'
17
- s.date = '2020-12-04'
18
- s.rubyforge_project = 'shindo'
16
+ s.version = '0.3.11'
17
+ s.date = '2024-05-03'
19
18
 
20
19
  ## Make sure your summary is short. The description may be as long
21
20
  ## as you like.
@@ -28,6 +27,7 @@ Gem::Specification.new do |s|
28
27
  s.authors = ["geemus (Wesley Beary)"]
29
28
  s.email = 'geemus@gmail.com'
30
29
  s.homepage = 'http://github.com/geemus/shindo'
30
+ s.license = 'MIT'
31
31
 
32
32
  ## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
33
33
  ## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
@@ -39,7 +39,6 @@ Gem::Specification.new do |s|
39
39
 
40
40
  ## If your gem includes any executables, list them here.
41
41
  s.executables = ['shindo', 'shindont']
42
- s.default_executable = 'shindo'
43
42
 
44
43
  ## Specify any RDoc options here. You'll want to add your README and
45
44
  ## LICENSE files to the extra_rdoc_files list.
@@ -53,13 +52,8 @@ Gem::Specification.new do |s|
53
52
  ## List your development dependencies here. Development dependencies are
54
53
  ## those that are only needed during development
55
54
  # s.add_development_dependency('DEVDEPNAME', [">= 1.1.0", "< 2.0.0"])
56
-
57
- if RUBY_VERSION.to_f <= 1.8
58
- s.add_development_dependency('rake', '~> 10.5')
59
- else
60
- s.add_development_dependency('rake')
61
- end
62
55
 
56
+ s.add_development_dependency('rake')
63
57
  s.add_development_dependency('rdoc')
64
58
 
65
59
  ## Leave this section as-is. It will be automatically generated from the
data/tests/bin_tests.rb CHANGED
@@ -30,16 +30,16 @@ Shindo.tests('bin') do
30
30
 
31
31
  tests('error') do
32
32
  @output = bin(path('error'))
33
- includes('ok + returns true') { @output }
34
- includes('1 errored, 1 succeeded') { @output }
33
+ includes('ok + returns true') { @output }
34
+ includes('1 errored and 1 succeeded') { @output }
35
35
 
36
36
  tests('$?.exitstatus').returns(1) { $?.exitstatus }
37
37
  end
38
38
 
39
39
  tests('contained-error') do
40
40
  @output = bin(path('contained-error'))
41
- includes('ok + returns true') { @output }
42
- includes('1 failed, 1 errored, 1 succeeded') { @output }
41
+ includes('ok + returns true') { @output }
42
+ includes('1 failed, 1 errored and 1 succeeded') { @output }
43
43
 
44
44
  tests('$?.exitstatus').returns(1) { $?.exitstatus }
45
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shindo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - geemus (Wesley Beary)
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-04 00:00:00.000000000 Z
11
+ date: 2024-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: formatador
@@ -89,9 +89,10 @@ files:
89
89
  - tests/tag_tests.rb
90
90
  - tests/tests_helper.rb
91
91
  homepage: http://github.com/geemus/shindo
92
- licenses: []
92
+ licenses:
93
+ - MIT
93
94
  metadata: {}
94
- post_install_message:
95
+ post_install_message:
95
96
  rdoc_options:
96
97
  - "--charset=UTF-8"
97
98
  require_paths:
@@ -107,8 +108,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
108
  - !ruby/object:Gem::Version
108
109
  version: '0'
109
110
  requirements: []
110
- rubygems_version: 3.1.4
111
- signing_key:
111
+ rubygems_version: 3.4.22
112
+ signing_key:
112
113
  specification_version: 2
113
114
  summary: Simple depth first Ruby testing.
114
115
  test_files: []