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 ADDED
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 1.9.2
5
+ - rbx-19mode
6
+ - ruby-head
7
+ script: bundle exec ruby uspec/uspec_spec.rb
8
+ before_install:
9
+ - gem update bundler
10
+ before_script:
11
+ - bundle exec gem list
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
+
@@ -0,0 +1,10 @@
1
+ require 'bundler/setup'
2
+
3
+ Bundler.require :development, :test
4
+
5
+ require 'uspec'
6
+
7
+ Dir.chdir File.dirname(__FILE__)
8
+
9
+ extend Uspec
10
+
data/lib/uspec/dsl.rb CHANGED
@@ -5,7 +5,7 @@ module Uspec
5
5
 
6
6
  print ' -- ', description
7
7
 
8
- return puts(': ' + formatter.yellow('pending') + formatter.vspace) unless block_given?
8
+ return print(': ' + formatter.yellow('pending') + formatter.vspace) unless block_given?
9
9
 
10
10
  begin
11
11
  result = yield
data/lib/uspec/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Uspec
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
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.2
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-07 00:00:00.000000000 Z
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