scampi 0.1.4 → 0.1.6
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/README.md +8 -6
- data/lib/rubygems_plugin.rb +1 -38
- data/lib/scampi/kernel_ext.rb +38 -0
- data/lib/scampi/version.rb +1 -3
- data/lib/scampi/version.rb.erb +0 -2
- data/lib/scampi.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: 3d4ea4ec73208870f1578c9a9692ad391f76e5a40de28ad371d966ebeeeea095
|
|
4
|
+
data.tar.gz: e542d8bb09d7d121976f41daa04b1f62609302a81fdd030bd9183525dea18086
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 03c07b2b4e3eea11ab08873bf96467b0bca682f55230ce644451e4628d638bcec91bebd01046d9ca907b5c55bf4ea024b25d0a0aca719f977bacd7b3139e97bd
|
|
7
|
+
data.tar.gz: 777988311e98de67d4d340314fe2d4d87980b3fefa275c28d202dc29d37017ad0fe0f42069e26927a5f78ed38415884ecf42868018ca047bd2033b6cced5476e
|
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.6)
|
|
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.6)
|
|
26
26
|
|
|
27
27
|
BUNDLED WITH
|
|
28
28
|
4.0.7
|
data/README.md
CHANGED
|
@@ -11,16 +11,18 @@ Tests can live alongside your code using the `test` block — it only runs when
|
|
|
11
11
|
def greet(name) = "hello #{name}"
|
|
12
12
|
|
|
13
13
|
test do
|
|
14
|
+
greeting = proc { |name| greet(name) }
|
|
15
|
+
|
|
14
16
|
it "equality and matching" do
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
greeting.("world").should == "hello world"
|
|
18
|
+
greeting.("world").should.equal "hello world"
|
|
19
|
+
greeting.("world").should =~ /hello/
|
|
20
|
+
greeting.("world").should.match(/hello/)
|
|
19
21
|
end
|
|
20
22
|
|
|
21
23
|
it "negation" do
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
greeting.("world").should.not == "goodbye"
|
|
25
|
+
greeting.("world").should.not.match(/goodbye/)
|
|
24
26
|
end
|
|
25
27
|
|
|
26
28
|
it "predicates" do
|
data/lib/rubygems_plugin.rb
CHANGED
|
@@ -1,38 +1 @@
|
|
|
1
|
-
|
|
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
|
|
1
|
+
require 'scampi'
|
|
@@ -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
data/lib/scampi/version.rb.erb
CHANGED
data/lib/scampi.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.6
|
|
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
|