chibineko-rspec 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/README.md +67 -23
- data/lib/chibineko/rspec/matcher.rb +3 -9
- data/lib/chibineko/rspec/version.rb +1 -1
- data/lib/chibineko/testitem.rb +6 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db3dfe40242bfc4f85820b4ff401556108dc8603
|
4
|
+
data.tar.gz: efd58a38b9c73288bf186f60bc47dc1ee19a7ea1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf88826f721ddbdbb73d6e2696a68866a8caf0f8c9e8c2f08f8a7a92949cc3f7319a4be96c22fb28f99e4cd9e2d4e3124b61b1f04b45d890f25554eba2c877ec
|
7
|
+
data.tar.gz: 5f92b13bf722a0ee9add8ee96e045f60b0344ada6d72df39e18464b0d04243b1e224fdf8d074b660c8bdc62a683ca79d272b84718f292e5ad558a4bdb627b7f9
|
data/README.md
CHANGED
@@ -1,62 +1,106 @@
|
|
1
|
-
# Chibineko::RSpec
|
2
|
-
|
3
1
|
[](https://travis-ci.org/tinsep19/chibineko-rspec)
|
4
2
|
[](https://codeclimate.com/github/tinsep19/chibineko-rspec)
|
5
3
|
[](https://coveralls.io/r/tinsep19/chibineko-rspec)
|
6
4
|
|
7
|
-
|
5
|
+
# Chibineko::RSpec
|
6
|
+
|
7
|
+
chibineko-rspecは[chibineko](http://chibineko.jp)とRSpecを統合します。
|
8
8
|
|
9
|
+
ソフトウェアの開発ですべてのテストを自動化することは容易ではなく、少なからず人による確認があります。
|
10
|
+
chibinekoはそのような部分に対して簡易、且つ有用な機能を提供するサービスです。
|
9
11
|
|
10
|
-
|
12
|
+
chibinekoの開発者による開発の背景、サービスの説明
|
13
|
+
http://qiita.com/tabbyz/items/6513e84f319843c316d5
|
11
14
|
|
12
|
-
Add this line to your application's Gemfile:
|
13
15
|
|
14
|
-
|
16
|
+
chibineko-rspecはRSpecによる自動化されたテストとchibinekoによる人手による確認とをRSpec上に統合し、人手がかかる部分もCIのサイクルに組み込むことを目的にしています。
|
15
17
|
|
18
|
+
## インストール
|
19
|
+
|
20
|
+
Gemfileにchibineko-rspecを追加し、 `$ bundle install` を実行します。
|
16
21
|
|
17
22
|
```ruby
|
18
|
-
gem 'chibineko-rspec'
|
19
|
-
```
|
20
23
|
|
21
|
-
|
24
|
+
gem 'chibineko-rspec'
|
22
25
|
|
23
|
-
|
26
|
+
```
|
24
27
|
|
25
28
|
|
26
|
-
|
29
|
+
もしくはgemでインストールします。
|
27
30
|
|
28
31
|
$ gem install chibineko-rspec
|
29
32
|
|
30
|
-
##
|
31
|
-
|
32
|
-
### Set up
|
33
|
+
## 使い方
|
33
34
|
|
34
|
-
|
35
|
+
Chibineko::RSpec::Helperモジュールをextendして使います。
|
35
36
|
|
37
|
+
```ruby
|
38
|
+
require 'chibineko/rspec'
|
39
|
+
RSpec.describe "release spec" do
|
40
|
+
extend Chibineko::RSpec::Helper
|
41
|
+
include_chibineko("https://chibineko.jp/t/PATH_TO_YOUR_TESTCASE")
|
42
|
+
end
|
36
43
|
```
|
37
44
|
|
45
|
+
spec_helper.rb内で設定する場合には下記のようにします。
|
46
|
+
|
47
|
+
```ruby
|
38
48
|
require "chibineko/rspec"
|
39
49
|
RSpec.configure do |c|
|
40
50
|
c.extend Chibineko::RSpec::Helper
|
41
51
|
end
|
42
|
-
|
43
52
|
```
|
44
53
|
|
45
|
-
|
54
|
+
## include_chibineko
|
46
55
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
```
|
56
|
+
include_chibineko(url)を使用することにより、
|
57
|
+
chibinekoのテストケースをRSpec内に展開します。
|
51
58
|
|
59
|
+
```ruby
|
60
|
+
require 'chibineko/rspec'
|
52
61
|
RSpec.describe "release spec" do
|
53
|
-
|
62
|
+
extend Chibineko::RSpec::Helper
|
63
|
+
include_chibineko("https://chibineko.jp/t/FBguDcDQCiOI8MigD936BA")
|
54
64
|
end
|
65
|
+
```
|
66
|
+
|
67
|
+
例えば、上記を実行した結果は下記のようになります。
|
68
|
+
|
69
|
+
```
|
70
|
+
chibineko/rspec
|
71
|
+
ログイン機能
|
72
|
+
ログイン時のプログレスインジケーターの回転が綺麗なこと (FAILED - 1)
|
73
|
+
文字入力
|
74
|
+
キーボードが表示されたときにテキストフィールドが隠れてしまわないこと
|
75
|
+
機種変更
|
76
|
+
機種変した際にデータが引き継がれること (FAILED - 2)
|
77
|
+
変更前の端末
|
78
|
+
変更後の端末で再登録したのでこの端末では操作できないことを伝える (FAILED - 3)
|
79
|
+
変更後の端末
|
80
|
+
データ移行のあいだ他のアプリの紹介をすること (PENDING: Temporarily skipped with xit)
|
81
|
+
|
82
|
+
(中略)
|
83
|
+
|
84
|
+
Finished in 0.01376 seconds (files took 3.73 seconds to load)
|
85
|
+
5 examples, 3 failures, 1 pending
|
55
86
|
|
56
87
|
```
|
57
88
|
|
89
|
+
[元のテストケース](https://chibineko.jp/t/FBguDcDQCiOI8MigD936BA)と比較してみてください
|
90
|
+
|
91
|
+
|
92
|
+
## 動作概要
|
93
|
+
|
94
|
+
chibinekoのCSVのダウンロード機能を使用し、CSVの内容から動的にExampleGroup, Exampleを追加していきます。
|
95
|
+
その際、ヘッダ部分はExampleGroupとしてグループ化され、項目がExampleへと変換されます。
|
96
|
+
chibinekoでのテスト結果はそれぞれ、次のように変換されます。
|
97
|
+
- OK、NG、未実施
|
98
|
+
- `it 項目 do ; expect(testcase).to be_ok; end` be_okはテスト結果がOKの場合のみ成功します。
|
99
|
+
- 保留中
|
100
|
+
- `it 項目 do ; pending ; end`
|
101
|
+
- 対象外
|
102
|
+
- `xit 項目 do ; expect(testcase).to be_ok; end`
|
58
103
|
|
59
|
-
`includes_chibineko` will download csv and generate examples in current example-group.
|
60
104
|
|
61
105
|
## Development
|
62
106
|
|
@@ -7,16 +7,10 @@ RSpec::Matchers.define :be_ok do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
description do
|
10
|
-
"should be
|
10
|
+
"should be passed."
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
failure_message do |actual|
|
14
|
-
|
15
|
-
# NG
|
16
|
-
"expected that #{actual.item} should be completed."
|
17
|
-
else
|
18
|
-
# 未実施
|
19
|
-
"expected that #{actual.item} should be executed."
|
20
|
-
end
|
14
|
+
"expected that #{actual.item} should be passed."
|
21
15
|
end
|
22
16
|
end
|
data/lib/chibineko/testitem.rb
CHANGED
@@ -3,12 +3,14 @@ require "csv"
|
|
3
3
|
|
4
4
|
module Chibineko
|
5
5
|
class TestItem
|
6
|
-
STATUS_OK=["OK"]
|
7
|
-
STATUS_PENDING=["保留"]
|
8
|
-
STATUS_FAIL=["NG","未実施"]
|
9
|
-
STATUS_SKIP=["対象外"]
|
10
6
|
GROUP_DEPTH=5
|
11
7
|
|
8
|
+
STATUS_OK=["OK","Passed"]
|
9
|
+
STATUS_PENDING=["保留","Deferred"]
|
10
|
+
STATUS_FAIL=["NG","Failed"]
|
11
|
+
STATUS_NOT_EXEC = ["未実施","Not started"]
|
12
|
+
STATUS_SKIP=["対象外","N/A"]
|
13
|
+
|
12
14
|
attr_accessor :groups, :item, :status, :memo, :source, :line
|
13
15
|
|
14
16
|
def initialize(row, src, line_num = -1)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chibineko-rspec
|
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
|
- Kousuke TANIGUCHI
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|