rspec-advanced_subject 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/rspec-advanced_subject.rb +10 -0
- metadata +73 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 722cf7491396807cf442c184f6d94431218ea4ff
|
4
|
+
data.tar.gz: 3f203f3370aae6b2a6504c836bfd8e213a876c03
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a44a957f9366e20f87a5145aaff09cebcc0649b21d549b3226ff6362eb83727b6c302eaff11e14e51f12de56cf230fcf5b8fc65a4a746c05e63f7af79152e8f0
|
7
|
+
data.tar.gz: 1da7e0499723a02967fb459b75b376f07a1315944752c23d4dc2e477d971678812c85302d126c5f69a566e8a2e7e7a1fcebfca76f49dc6b1657167bf0e108ca2
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module RSpec
|
2
|
+
module AdvancedSubject
|
3
|
+
end
|
4
|
+
end
|
5
|
+
|
6
|
+
require 'rspec-advanced_subject/when_passed'
|
7
|
+
require 'rspec-advanced_subject/common_methods'
|
8
|
+
require 'rspec-advanced_subject/instance_method_example_group'
|
9
|
+
require 'rspec-advanced_subject/class_method_example_group'
|
10
|
+
require 'rspec-advanced_subject/class_example_group'
|
metadata
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rspec-advanced_subject
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kelly Stannard
|
8
|
+
- Kelly Stannard
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-07-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '3.0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '3.0'
|
28
|
+
description: |
|
29
|
+
advanced_subject attempts to cut out having to explicitly write the subject of your example group when trying to call methods or add arguments to methods. It works by reading the conventional description syntax to determine what the method you are calling is and later you state what you are passing to it.
|
30
|
+
|
31
|
+
Given you have a file advanced_subject_spec.rb.
|
32
|
+
```ruby
|
33
|
+
describe Hash do
|
34
|
+
when_initialized_with [:a, :b] do
|
35
|
+
it { should eq({a: :b}) }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
```
|
39
|
+
|
40
|
+
When you run `rspec -f d advanced_subject_spec.rb` it will output:
|
41
|
+
```
|
42
|
+
```
|
43
|
+
email: kwstannard@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- lib/rspec-advanced_subject.rb
|
49
|
+
homepage: https://github.com/kwstannard/rspec-advanced_subject
|
50
|
+
licenses:
|
51
|
+
- MIT
|
52
|
+
metadata: {}
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
requirements: []
|
68
|
+
rubyforge_project:
|
69
|
+
rubygems_version: 2.2.2
|
70
|
+
signing_key:
|
71
|
+
specification_version: 4
|
72
|
+
summary: adding arguments to the subject
|
73
|
+
test_files: []
|