scampi 0.1.5 → 0.1.7
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/exe/scampi +1 -1
- data/lib/scampi/kernel_ext.rb +38 -0
- data/lib/scampi/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 99eb417e803c7525a38193c3da9ce807c253564e57dc36b0e67ca4bc1e5b3a2d
|
|
4
|
+
data.tar.gz: 0c841e6e75066bbeb5d6eb3c00501cf27b8aa857353d90016e9cc5318faaa3c8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b39bbb20d5c2a2df8517e4f51889b9e9c57dc23a1441c10334165b473aa4815c0ec2674c73b40a7cf373378293e3636ef59ab43e7b952d995b7f09cf10eff3fc
|
|
7
|
+
data.tar.gz: 0f8953c513902539107ee6aa85be84bebcb436adf99814539381ebe0fa412f51a414ebab9c7f7262acc0306f9758b19aa19654c848ee4b4a9eb992578a85cb10
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
scampi (0.1.
|
|
4
|
+
scampi (0.1.7)
|
|
5
5
|
colorize-extended
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -22,7 +22,7 @@ DEPENDENCIES
|
|
|
22
22
|
CHECKSUMS
|
|
23
23
|
colorize (1.1.0) sha256=30b5237f0603f6662ab8d1fc2bd4a96142b806c6415d79e45ef5fdc6a0cfc837
|
|
24
24
|
colorize-extended (0.1.0) sha256=e8c39986e41ee2e14623c8fa02cf851ef4b83d2fe1392daa2b4d81f0df7bedc9
|
|
25
|
-
scampi (0.1.
|
|
25
|
+
scampi (0.1.7)
|
|
26
26
|
|
|
27
27
|
BUNDLED WITH
|
|
28
28
|
4.0.7
|
data/exe/scampi
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module Kernel
|
|
2
|
+
# Conditionally run a test block.
|
|
3
|
+
#
|
|
4
|
+
# When placed in a Ruby file, the block is executed only when the file is
|
|
5
|
+
# run directly (ruby myfile.rb) or when ENV["TEST"] is set to "true".
|
|
6
|
+
# This lets you co-locate tests alongside implementation code.
|
|
7
|
+
#
|
|
8
|
+
# # mylib.rb
|
|
9
|
+
# def greet(name) = "hello #{name}"
|
|
10
|
+
#
|
|
11
|
+
# test do
|
|
12
|
+
# describe "greet" do
|
|
13
|
+
# it "says hello" do
|
|
14
|
+
# greet("world").should == "hello world"
|
|
15
|
+
# end
|
|
16
|
+
# end
|
|
17
|
+
# end
|
|
18
|
+
#
|
|
19
|
+
def test(&block)
|
|
20
|
+
loc = caller_locations(1, 1).first
|
|
21
|
+
caller_file = loc.absolute_path || loc.path
|
|
22
|
+
|
|
23
|
+
if ENV["TEST"] == "true"
|
|
24
|
+
require_relative '../scampi' unless defined?(Scampi)
|
|
25
|
+
Scampi.summary_on_exit
|
|
26
|
+
block.call
|
|
27
|
+
elsif caller_file && $0
|
|
28
|
+
program = File.expand_path($0) rescue $0
|
|
29
|
+
caller_expanded = File.expand_path(caller_file) rescue caller_file
|
|
30
|
+
if caller_expanded == program
|
|
31
|
+
require_relative '../scampi' unless defined?(Scampi)
|
|
32
|
+
Scampi.summary_on_exit
|
|
33
|
+
block.call
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
private :test
|
|
38
|
+
end
|
data/lib/scampi/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: scampi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nathan K
|
|
@@ -52,6 +52,7 @@ files:
|
|
|
52
52
|
- lib/scampi.rb
|
|
53
53
|
- lib/scampi/context.rb
|
|
54
54
|
- lib/scampi/error.rb
|
|
55
|
+
- lib/scampi/kernel_ext.rb
|
|
55
56
|
- lib/scampi/monkey_patches.rb
|
|
56
57
|
- lib/scampi/should.rb
|
|
57
58
|
- lib/scampi/version.rb
|