asrt 0.1.0 → 0.1.1
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 +5 -5
- data/README.rst +14 -15
- data/Rakefile +1 -0
- data/asrt.gemspec +1 -1
- data/lib/asrt.rb +2 -0
- data/spec/asrt/fallible_spec.rb +8 -1
- data/spec/spec_helper.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0d671264b1c242e39d2573a3af4c5b47d508c55
|
4
|
+
data.tar.gz: 7be563b687cf57904b36718e0ffbae8962844345
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff7c7bb692ed6dfb883560892024b060aba6cc51c54a324ccb54ebaeaa10438de22b9fce433620acf7968c2b2913436e4e8cdbb499e0401a0744a50801a437ba
|
7
|
+
data.tar.gz: 36ffdea526827b99a600fc1b50b5061fb6e48c5a04be059b1218232d61b344708d3a3cbc672d64ed1effc3734b13aa5eb38f8c5f22e13c6984c305ef83e77030
|
data/Gemfile
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
+
group :coverage do
|
4
|
+
gem 'coveralls', require: false
|
5
|
+
end
|
6
|
+
|
3
7
|
group :test do
|
4
8
|
gem 'rspec'
|
5
9
|
gem 'rake'
|
6
10
|
end
|
7
11
|
|
8
|
-
group :
|
9
|
-
gem 'coveralls', require: false
|
10
|
-
end
|
11
|
-
|
12
|
-
group :development do
|
12
|
+
group :development, :test do
|
13
13
|
gem 'pry'
|
14
14
|
end
|
data/README.rst
CHANGED
@@ -7,6 +7,18 @@
|
|
7
7
|
asrt
|
8
8
|
==========
|
9
9
|
|
10
|
+
.. image:: https://travis-ci.org/ct-clearhaus/asrt.png?branch=master
|
11
|
+
:alt: Build Status
|
12
|
+
:target: https://travis-ci.org/ct-clearhaus/asrt
|
13
|
+
|
14
|
+
.. image:: https://codeclimate.com/github/ct-clearhaus/asrt.png
|
15
|
+
:alt: Code Climate
|
16
|
+
:target: https://codeclimate.com/github/ct-clearhaus/asrt
|
17
|
+
|
18
|
+
.. image:: https://coveralls.io/repos/ct-clearhaus/asrt/badge.png?branch=master
|
19
|
+
:alt: Coveralls
|
20
|
+
:target: https://coveralls.io/r/ct-clearhaus/asrt
|
21
|
+
|
10
22
|
.. image:: http://img.shields.io/license/MIT.png?color=green
|
11
23
|
:alt: MIT License
|
12
24
|
:target: http://opensource.org/licenses/MIT
|
@@ -15,14 +27,14 @@ Introduction
|
|
15
27
|
------------
|
16
28
|
|
17
29
|
`This gem <https://rubygems.org/gems/asrt>`_ simply gives you :ruby:`asrt` so
|
18
|
-
you can do
|
30
|
+
you can do assertions like this:
|
19
31
|
|
20
32
|
.. code-block:: ruby
|
21
33
|
|
22
34
|
def funny(input)
|
23
35
|
asrt input.is_a?(String), 'Me only eat strings.'
|
24
36
|
|
25
|
-
input + ' is funny'
|
37
|
+
input.strip + ' is funny'
|
26
38
|
end
|
27
39
|
|
28
40
|
Why use :ruby:`asrt` rather than :ruby:`assert`? Well, it's short and you may
|
@@ -44,19 +56,6 @@ Dependencies
|
|
44
56
|
None.
|
45
57
|
|
46
58
|
|
47
|
-
Examples
|
48
|
-
--------
|
49
|
-
|
50
|
-
.. code-block:: ruby
|
51
|
-
|
52
|
-
def funny(input)
|
53
|
-
asrt input.is_a?(String), 'Me only eat strings.'
|
54
|
-
|
55
|
-
input + ' is funny'
|
56
|
-
end
|
57
|
-
|
58
|
-
|
59
|
-
|
60
59
|
Contribute
|
61
60
|
----------
|
62
61
|
|
data/Rakefile
CHANGED
data/asrt.gemspec
CHANGED
data/lib/asrt.rb
CHANGED
data/spec/asrt/fallible_spec.rb
CHANGED
@@ -28,9 +28,16 @@ describe 'Asrt::Fallible#asrt' do
|
|
28
28
|
expect{ asrt { true } }.to_not raise_error
|
29
29
|
end
|
30
30
|
|
31
|
+
context 'when failing with a block' do
|
32
|
+
it 'includes file name and line number in the message' do
|
33
|
+
expect{ asrt { false } }.to raise_error(Asrt::AssertionError, /\A#{__FILE__}:\d+:\z/)
|
34
|
+
expect{ asrt 'msg' do false end }.to raise_error(Asrt::AssertionError, /\A#{__FILE__}:\d+:msg\z/)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
31
38
|
it 'should fail with the given message, when failing' do
|
32
39
|
expect{ asrt false, 'msg' }.to raise_error(Asrt::AssertionError, 'msg')
|
33
|
-
expect{ asrt 'msg' do false end }.to raise_error(Asrt::AssertionError,
|
40
|
+
expect{ asrt 'msg' do false end }.to raise_error(Asrt::AssertionError, /msg/)
|
34
41
|
end
|
35
42
|
|
36
43
|
it 'should complain when too many arguments are given' do
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asrt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Casper Thomsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Allows you to assert things to be true in your code.
|
14
14
|
email: ct@clearhaus.com
|
@@ -27,6 +27,7 @@ files:
|
|
27
27
|
- lib/asrt.rb
|
28
28
|
- spec/asrt/fallible_spec.rb
|
29
29
|
- spec/asrt/infallible_spec.rb
|
30
|
+
- spec/spec_helper.rb
|
30
31
|
homepage: https://github.com/ct-clearhaus/asrt
|
31
32
|
licenses:
|
32
33
|
- MIT
|