uspec 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +11 -0
- data/README.markdown +10 -8
- data/example_specs/example_spec.rb +21 -0
- data/example_specs/spec_helper.rb +10 -0
- data/lib/uspec/dsl.rb +1 -1
- data/lib/uspec/version.rb +1 -1
- metadata +5 -2
data/.travis.yml
ADDED
data/README.markdown
CHANGED
@@ -5,12 +5,14 @@ Uspec is a shiny little testing framework for your apps!
|
|
5
5
|
|
6
6
|
Anthony M. Cook 2013
|
7
7
|
|
8
|
+
[![Build Status](https://travis-ci.org/acook/uspec.png?branch=master)](https://travis-ci.org/acook/uspec)
|
8
9
|
[![Code Climate](https://codeclimate.com/github/acook/uspec.png)](https://codeclimate.com/github/acook/uspec)
|
10
|
+
[![Still Maintained](http://stillmaintained.com/acook/uspec.png)](http://stillmaintained.com/acook/uspec)
|
9
11
|
|
10
12
|
Philosophy / Why Uspec?
|
11
13
|
-----------------------
|
12
14
|
|
13
|
-
Unlike other testing frameworks there's no need for matchers, there can only be one assertion per test, and you never have to worry that your tests lack assertions.
|
15
|
+
Unlike other testing frameworks there's no need for special matchers, there can only be one assertion per test, and you never have to worry that your tests lack assertions.
|
14
16
|
|
15
17
|
That's because when the `spec` block is evaluated the return value is used (in a very ruby-like way) to determine the validity of the statement. Standard Ruby comparisons are your friend! No more digging around in your test framework's documentation to figure out what matcher you're supposed to use.
|
16
18
|
|
@@ -52,12 +54,12 @@ If it throws an error:
|
|
52
54
|
|
53
55
|
```
|
54
56
|
-- AwesomeMcCoolname.generate creates a cool name: Exception
|
55
|
-
|
57
|
+
|
56
58
|
Encountered an Exception while running spec
|
57
59
|
at uspec/awesome_mc_coolname_spec.rb:3: in `<main>'
|
58
|
-
|
60
|
+
|
59
61
|
RuntimeError < StandardError: 'wtf'
|
60
|
-
|
62
|
+
|
61
63
|
/Users/Dude/Projects/Awesome/lib/awesome_mc_coolname.rb:18:in `explode'
|
62
64
|
uspec/awesome_mc_coolname_spec.rb:4:in `block in <main>'
|
63
65
|
```
|
@@ -74,10 +76,10 @@ Then Uspec will let you know:
|
|
74
76
|
|
75
77
|
```ruby
|
76
78
|
-- AwesomeMcCoolname.generate creates a badass name: Unknown Result
|
77
|
-
|
79
|
+
|
78
80
|
Spec did not return a boolean value
|
79
81
|
at uspec/awesome_mc_coolname_spec.rb:6: in `<main>'
|
80
|
-
|
82
|
+
|
81
83
|
Integer < Numeric: 5
|
82
84
|
```
|
83
85
|
|
@@ -89,8 +91,8 @@ spec 'AwesomeMcCoolname.generate creates a cool name' do
|
|
89
91
|
end
|
90
92
|
```
|
91
93
|
|
92
|
-
If you really need to regex, you can always use Ruby's `!!` idiom to coerce a boolean out of any result,
|
93
|
-
but its more precise to specify the index if you know it.
|
94
|
+
If you really need to regex, you can always use Ruby's `!!` idiom to coerce a boolean out of any result,
|
95
|
+
but its more precise to specify the index if you know it.
|
94
96
|
And you can always toss in an `||` to drop in more information if a comparison fails too:
|
95
97
|
|
96
98
|
```ruby
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative 'spec_helper'
|
2
|
+
|
3
|
+
spec 'I love passing tests' do
|
4
|
+
true
|
5
|
+
end
|
6
|
+
|
7
|
+
spec "This is an idea, but I haven't written the test yet"
|
8
|
+
|
9
|
+
spec 'Failing tests display a red' do
|
10
|
+
false
|
11
|
+
end
|
12
|
+
|
13
|
+
spec 'Inspects non-boolean value that the spec block returns' do
|
14
|
+
'non-boolean value'
|
15
|
+
end
|
16
|
+
|
17
|
+
spec 'Displays informative exceptions' do
|
18
|
+
class ExampleError < RuntimeError; end
|
19
|
+
raise ExampleError
|
20
|
+
end
|
21
|
+
|
data/lib/uspec/dsl.rb
CHANGED
data/lib/uspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-08 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Uspec is a shiny little spec framework for your apps! Unlike other testing
|
15
15
|
frameworks there's no need for matchers, there can only be one assertion per test,
|
@@ -21,10 +21,13 @@ extensions: []
|
|
21
21
|
extra_rdoc_files: []
|
22
22
|
files:
|
23
23
|
- .gitignore
|
24
|
+
- .travis.yml
|
24
25
|
- Gemfile
|
25
26
|
- LICENSE.txt
|
26
27
|
- README.markdown
|
27
28
|
- Rakefile
|
29
|
+
- example_specs/example_spec.rb
|
30
|
+
- example_specs/spec_helper.rb
|
28
31
|
- lib/uspec.rb
|
29
32
|
- lib/uspec/dsl.rb
|
30
33
|
- lib/uspec/formatter.rb
|