r_spec 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -15
- data/lib/r_spec.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06e4fca8d3ac445a345995ef83326fd9627fe438c5b712343ccfc2b04f475e8f
|
4
|
+
data.tar.gz: f06268504b401ec16c575df69637141b6ad14af67c217059a4383376651c0e21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8f3551cf97eb212ae68ab09d6ab1f633bd8b4770a8ad29131bf17143ac897df487e7928a1e8f61c06c0c05f791be07ffe1c3cae1706a3686116ef577e61f032
|
7
|
+
data.tar.gz: 5a1d5e24bde9be03408cfde4c651700048b1285e7b8917a27c9763f97ced1acb901c519fd51a3ef8acdd780eb7025789d22db3ad7f96eced5847908b27fda9cb
|
data/README.md
CHANGED
@@ -2,29 +2,27 @@
|
|
2
2
|
|
3
3
|
> A small [RSpec](https://github.com/rspec) clone based on [Fix testing tools for Ruby](https://github.com/fixrb).
|
4
4
|
|
5
|
-
|
5
|
+
## Status
|
6
|
+
|
7
|
+
[![Home](https://img.shields.io/badge/Home-r--spec.dev-00af8b)](https://r-spec.dev/)
|
8
|
+
[![Version](https://img.shields.io/github/v/tag/cyril/r_spec.rb?label=Version&logo=github)](https://github.com/cyril/r_spec.rb/tags)
|
9
|
+
[![Yard documentation](https://img.shields.io/badge/Yard-documentation-blue.svg?logo=github)](https://rubydoc.info/github/cyril/r_spec.rb/main)
|
10
|
+
[![Ruby](https://github.com/cyril/r_spec.rb/workflows/Ruby/badge.svg?branch=main)](https://github.com/cyril/r_spec.rb/actions?query=workflow%3Aruby+branch%3Amain)
|
11
|
+
[![RuboCop](https://github.com/cyril/r_spec.rb/workflows/RuboCop/badge.svg?branch=main)](https://github.com/cyril/r_spec.rb/actions?query=workflow%3Arubocop+branch%3Amain)
|
12
|
+
[![License](https://img.shields.io/github/license/cyril/r_spec.rb?label=License&logo=github)](https://github.com/cyril/r_spec.rb/raw/main/LICENSE.md)
|
6
13
|
|
7
|
-
|
14
|
+
## Warning ⚠️
|
8
15
|
|
9
16
|
I'd like to avoid confusion in the Ruby community by emphasizing that the gem of this project is not [rspec](https://rubygems.org/gems/rspec) but [r_spec](https://rubygems.org/gems/r_spec).
|
10
17
|
|
11
18
|
The [r_spec](https://rubygems.org/gems/r_spec) gem is a minimalist and personal reimplementation of the popular RSpec framework. My reimplementation is therefore independent of the original RSpec project.
|
12
19
|
|
20
|
+
![On the job](https://github.com/cyril/r_spec.rb/raw/main/img/on-the-job.jpg)
|
21
|
+
|
13
22
|
For the purpose of the DSL reimplementation, I have kept the same `RSpec` module name, and following the [Ruby gems naming convention](https://guides.rubygems.org/name-your-gem/#use-underscores-for-multiple-words), I called its gem [r_spec](https://rubygems.org/gems/r_spec).
|
14
23
|
|
15
24
|
However, to go further and explicitly indicate that this reimplementation is a clone, I have grouped all the code in a `RSpec::Clone` submodule within its [r_spec-clone](https://rubygems.org/gems/r_spec-clone) gem.
|
16
25
|
|
17
|
-
***
|
18
|
-
|
19
|
-
## Status
|
20
|
-
|
21
|
-
[![Home](https://img.shields.io/badge/Home-r--spec.dev-00af8b)](https://r-spec.dev/)
|
22
|
-
[![Version](https://img.shields.io/github/v/tag/cyril/r_spec.rb?label=Version&logo=github)](https://github.com/cyril/r_spec.rb/releases)
|
23
|
-
[![Yard documentation](https://img.shields.io/badge/Yard-documentation-blue.svg?logo=github)](https://rubydoc.info/github/cyril/r_spec.rb/main)
|
24
|
-
[![CI](https://github.com/cyril/r_spec.rb/workflows/CI/badge.svg?branch=main)](https://github.com/cyril/r_spec.rb/actions?query=workflow%3Aci+branch%3Amain)
|
25
|
-
[![RuboCop](https://github.com/cyril/r_spec.rb/workflows/RuboCop/badge.svg?branch=main)](https://github.com/cyril/r_spec.rb/actions?query=workflow%3Arubocop+branch%3Amain)
|
26
|
-
[![License](https://img.shields.io/github/license/cyril/r_spec.rb?label=License&logo=github)](https://github.com/cyril/r_spec.rb/raw/main/LICENSE.md)
|
27
|
-
|
28
26
|
## Why did I redid that?
|
29
27
|
|
30
28
|
An urge to simplify the RSpec DSL and reduce the complexity of the code that implements it, and nothing better to do during a stay in Tokyo.
|
@@ -49,11 +47,23 @@ Or install it yourself as:
|
|
49
47
|
gem install r_spec
|
50
48
|
```
|
51
49
|
|
52
|
-
##
|
50
|
+
## Update
|
53
51
|
|
54
52
|
All the code is centralized in the `RSpec::Clone` module, whose source code is versioned at <https://github.com/cyril/r_spec-clone.rb>.
|
55
53
|
|
56
|
-
|
54
|
+
To download the latest updates of the [r_spec-clone](https://rubygems.org/gems/r_spec-clone) gem, this command can be executed:
|
55
|
+
|
56
|
+
```sh
|
57
|
+
bundle update r_spec
|
58
|
+
```
|
59
|
+
|
60
|
+
Or update it yourself as:
|
61
|
+
|
62
|
+
```sh
|
63
|
+
gem update r_spec
|
64
|
+
```
|
65
|
+
|
66
|
+
## Usage
|
57
67
|
|
58
68
|
Let's imagine a `string_hello_world_spec.rb` file that contains this code:
|
59
69
|
|
data/lib/r_spec.rb
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Top level namespace for the RSpec clone.
|
4
|
+
#
|
5
|
+
# @example The true from the false
|
6
|
+
# require "r_spec"
|
7
|
+
#
|
8
|
+
# RSpec.describe "The true from the false" do
|
9
|
+
# it { expect(false).not_to be true }
|
10
|
+
# end
|
11
|
+
#
|
12
|
+
# # Output to the console
|
13
|
+
# # Success: expected false not to be true.
|
14
|
+
#
|
4
15
|
# @see https://github.com/cyril/r_spec-clone.rb
|
5
16
|
module RSpec
|
6
17
|
end
|