insist 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -0
- data/Gemfile.lock +30 -0
- data/README.md +1 -0
- data/insist.gemspec +2 -2
- data/lib/insist/comparators.rb +1 -17
- data/lib/insist/comparators19.rb +23 -0
- data/spec/insist/comparators_spec.rb +2 -2
- metadata +64 -67
data/.travis.yml
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
insist (0.0.4)
|
5
|
+
cabin (> 0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
cabin (0.4.3)
|
11
|
+
json
|
12
|
+
diff-lcs (1.1.3)
|
13
|
+
json (1.6.5)
|
14
|
+
json (1.6.5-java)
|
15
|
+
rspec (2.8.0)
|
16
|
+
rspec-core (~> 2.8.0)
|
17
|
+
rspec-expectations (~> 2.8.0)
|
18
|
+
rspec-mocks (~> 2.8.0)
|
19
|
+
rspec-core (2.8.0)
|
20
|
+
rspec-expectations (2.8.0)
|
21
|
+
diff-lcs (~> 1.1.2)
|
22
|
+
rspec-mocks (2.8.0)
|
23
|
+
|
24
|
+
PLATFORMS
|
25
|
+
java
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
insist!
|
30
|
+
rspec (~> 2.8.0)
|
data/README.md
CHANGED
@@ -27,6 +27,7 @@ Using rspec's 'subject' stuff, you can write tests that are perhaps even more mi
|
|
27
27
|
Here's an example test that fails. The subject is an 'insist' object, so you
|
28
28
|
can just do the usual '==' and other methods on it:
|
29
29
|
|
30
|
+
# spec/example_spec.rb
|
30
31
|
describe "thing" do
|
31
32
|
subject { insist { "whoa!" } }
|
32
33
|
|
data/insist.gemspec
CHANGED
@@ -2,13 +2,13 @@ Gem::Specification.new do |spec|
|
|
2
2
|
files = %x{git ls-files}.split("\n")
|
3
3
|
|
4
4
|
spec.name = "insist"
|
5
|
-
spec.version = "0.0.
|
5
|
+
spec.version = "0.0.5"
|
6
6
|
spec.summary = "A simple block-driven assertion library for both testing and for production code"
|
7
7
|
spec.description = spec.summary
|
8
8
|
spec.license = "none chosen yet"
|
9
9
|
|
10
10
|
# Note: You should set the version explicitly.
|
11
|
-
spec.add_dependency "cabin", ">0" # for logging. apache 2 license
|
11
|
+
#spec.add_dependency "cabin", ">0" # for logging. apache 2 license
|
12
12
|
spec.files = files
|
13
13
|
spec.require_paths << "lib"
|
14
14
|
spec.bindir = "bin"
|
data/lib/insist/comparators.rb
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
# insist { "foo" } == "foo"
|
7
7
|
module Insist::Comparators
|
8
8
|
include Insist::Assert
|
9
|
+
require "insist/comparators19" if RUBY_VERSION >= "1.9.2"
|
9
10
|
|
10
11
|
# value == expected
|
11
12
|
def ==(expected)
|
@@ -37,21 +38,4 @@ module Insist::Comparators
|
|
37
38
|
"Expected #{value.inspect} < #{expected.inspect}")
|
38
39
|
end # def <
|
39
40
|
|
40
|
-
# value != expected
|
41
|
-
def !=(expected)
|
42
|
-
assert(value != expected,
|
43
|
-
"Expected #{value.inspect} != #{expected.inspect}")
|
44
|
-
end # def !=
|
45
|
-
|
46
|
-
# value =~ pattern
|
47
|
-
def =~(pattern)
|
48
|
-
assert(value =~ pattern,
|
49
|
-
"Expected #{value.inspect} =~ #{pattern.inspect}")
|
50
|
-
end # def =~
|
51
|
-
|
52
|
-
# value !~ pattern
|
53
|
-
def !~(pattern)
|
54
|
-
assert(value !~ pattern,
|
55
|
-
"Expected #{value.inspect} !~ #{pattern.inspect}")
|
56
|
-
end # def !~
|
57
41
|
end # module Insist::Comparators
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
# TODO(sissel): This requires ruby 1.9.x
|
3
|
+
module Insist::Comparators
|
4
|
+
# value != expected
|
5
|
+
def !=(expected)
|
6
|
+
assert(value != expected,
|
7
|
+
"Expected #{value.inspect} != #{expected.inspect}")
|
8
|
+
end # def !=
|
9
|
+
|
10
|
+
# TODO(sissel): This requires ruby 1.9.x
|
11
|
+
# value =~ pattern
|
12
|
+
def =~(pattern)
|
13
|
+
assert(value =~ pattern,
|
14
|
+
"Expected #{value.inspect} =~ #{pattern.inspect}")
|
15
|
+
end # def =~
|
16
|
+
|
17
|
+
# TODO(sissel): This requires ruby 1.9.x
|
18
|
+
# value !~ pattern
|
19
|
+
def !~(pattern)
|
20
|
+
assert(value !~ pattern,
|
21
|
+
"Expected #{value.inspect} !~ #{pattern.inspect}")
|
22
|
+
end # def !~
|
23
|
+
end
|
@@ -80,7 +80,7 @@ describe Insist::Comparators do
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
describe "#=~" do
|
83
|
+
describe "#=~", :if => (RUBY_VERSION >= "1.9.2") do
|
84
84
|
subject do
|
85
85
|
Insist.new { "hello" }
|
86
86
|
end
|
@@ -94,7 +94,7 @@ describe Insist::Comparators do
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
describe "#!~" do
|
97
|
+
describe "#!~", :if => (RUBY_VERSION >= "1.9.2") do
|
98
98
|
subject do
|
99
99
|
Insist.new { "hello" }
|
100
100
|
end
|
metadata
CHANGED
@@ -1,87 +1,84 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: insist
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.4
|
3
|
+
version: !ruby/object:Gem::Version
|
5
4
|
prerelease:
|
5
|
+
version: 0.0.5
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
- Jordan Sissel
|
7
|
+
authors:
|
8
|
+
- Jordan Sissel
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
- - ! '>'
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: *9912680
|
25
|
-
description: A simple block-driven assertion library for both testing and for production
|
26
|
-
code
|
27
|
-
email:
|
28
|
-
- jls@semicomplete.com
|
12
|
+
|
13
|
+
date: 2012-03-19 00:00:00 Z
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: A simple block-driven assertion library for both testing and for production code
|
17
|
+
email:
|
18
|
+
- jls@semicomplete.com
|
29
19
|
executables: []
|
20
|
+
|
30
21
|
extensions: []
|
22
|
+
|
31
23
|
extra_rdoc_files: []
|
32
|
-
|
33
|
-
|
34
|
-
- .
|
35
|
-
- .
|
36
|
-
-
|
37
|
-
-
|
38
|
-
-
|
39
|
-
-
|
40
|
-
-
|
41
|
-
-
|
42
|
-
- lib/insist
|
43
|
-
- lib/insist/
|
44
|
-
- lib/insist/
|
45
|
-
- lib/insist/
|
46
|
-
- lib/insist/
|
47
|
-
- lib/insist/
|
48
|
-
- lib/insist/
|
49
|
-
-
|
50
|
-
-
|
51
|
-
-
|
52
|
-
-
|
53
|
-
- spec/insist/
|
54
|
-
- spec/
|
55
|
-
- spec/
|
56
|
-
-
|
57
|
-
-
|
58
|
-
-
|
24
|
+
|
25
|
+
files:
|
26
|
+
- .batcave/manifest
|
27
|
+
- .gitignore
|
28
|
+
- .travis.yml
|
29
|
+
- Gemfile
|
30
|
+
- Gemfile.lock
|
31
|
+
- Makefile
|
32
|
+
- README.md
|
33
|
+
- insist.gemspec
|
34
|
+
- lib/insist.rb
|
35
|
+
- lib/insist/assert.rb
|
36
|
+
- lib/insist/comparators.rb
|
37
|
+
- lib/insist/comparators19.rb
|
38
|
+
- lib/insist/enumerables.rb
|
39
|
+
- lib/insist/failure.rb
|
40
|
+
- lib/insist/namespace.rb
|
41
|
+
- lib/insist/nil.rb
|
42
|
+
- lib/insist/predicates.rb
|
43
|
+
- lib/insist/raises.rb
|
44
|
+
- notify-failure.sh
|
45
|
+
- spec/insist/comparators_spec.rb
|
46
|
+
- spec/insist/enumerables_spec.rb
|
47
|
+
- spec/insist/nil_spec.rb
|
48
|
+
- spec/insist/predicates_spec.rb
|
49
|
+
- spec/insist_spec.rb
|
50
|
+
- spec/spec_setup.rb
|
51
|
+
- test/all.rb
|
52
|
+
- test/docs.rb
|
53
|
+
- test/testing.rb
|
59
54
|
homepage:
|
60
|
-
licenses:
|
61
|
-
- none chosen yet
|
55
|
+
licenses:
|
56
|
+
- none chosen yet
|
62
57
|
post_install_message:
|
63
58
|
rdoc_options: []
|
64
|
-
|
65
|
-
|
66
|
-
- lib
|
67
|
-
|
59
|
+
|
60
|
+
require_paths:
|
61
|
+
- lib
|
62
|
+
- lib
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
64
|
none: false
|
69
|
-
requirements:
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: "0"
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
70
|
none: false
|
75
|
-
requirements:
|
76
|
-
|
77
|
-
|
78
|
-
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: "0"
|
79
75
|
requirements: []
|
76
|
+
|
80
77
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.8.
|
78
|
+
rubygems_version: 1.8.15
|
82
79
|
signing_key:
|
83
80
|
specification_version: 3
|
84
|
-
summary: A simple block-driven assertion library for both testing and for production
|
85
|
-
code
|
81
|
+
summary: A simple block-driven assertion library for both testing and for production code
|
86
82
|
test_files: []
|
83
|
+
|
87
84
|
has_rdoc:
|