should_not 0.7.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/{LICENSE.txt → LICENSE.MIT} +0 -0
- data/README.md +24 -8
- data/Rakefile +1 -1
- data/integration/rspec.rb +1 -15
- data/lib/should_not/rspec.rb +0 -1
- data/lib/should_not/version.rb +1 -1
- data/should_not.gemspec +1 -1
- metadata +5 -5
data/{LICENSE.txt → LICENSE.MIT}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# should_not
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/
|
4
|
-
[![Code Climate](https://codeclimate.com/github/
|
3
|
+
[![Build Status](https://travis-ci.org/should-not/should_not.png?branch=master)](https://travis-ci.org/should-not/should_not)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/should-not/should_not.png)](https://codeclimate.com/github/should-not/should_not)
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/should_not.png)](http://badge.fury.io/rb/should_not)
|
6
6
|
|
7
|
-
You `should_not` start your specs with the string `"should"
|
7
|
+
You `should_not` start your specs with the string `"should"`:
|
8
|
+
if every spec begins with `"should"`, then `"should"` is redundant everywhere and becomes noise.
|
8
9
|
Use this gem to enforce that rule.
|
9
10
|
|
10
11
|
## Installation
|
@@ -29,10 +30,25 @@ In `spec_helper.rb`, add the line:
|
|
29
30
|
|
30
31
|
require 'should_not/rspec'
|
31
32
|
|
33
|
+
and then specs will fail if the `it` description starts with `should`.
|
34
|
+
|
35
|
+
### MiniTest
|
36
|
+
|
37
|
+
Make sure that somewhere you have
|
38
|
+
|
39
|
+
require 'should_not/minitest'
|
40
|
+
|
41
|
+
and then specs (`describe`/`it` syntax only) will fail if the `it` description starts with `should`.
|
42
|
+
|
32
43
|
## Contributing
|
33
44
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
45
|
+
Please port this library to your language of choice!
|
46
|
+
Once it's ready, I'll be happy to add your port as a repo under the [`should-not` organization](https://github.com/should-not).
|
47
|
+
|
48
|
+
If you'd like to contribute to the Ruby version `should_not`, we could use support for more testing frameworks.
|
49
|
+
Just make sure that you have integration test coverage before you open a pull request.
|
50
|
+
|
51
|
+
## License
|
52
|
+
|
53
|
+
Available under the terms of the MIT license.
|
54
|
+
See [LICENSE.MIT](LICENSE.MIT) for more details.
|
data/Rakefile
CHANGED
@@ -13,7 +13,7 @@ task :rspec do
|
|
13
13
|
out = StringIO.new
|
14
14
|
RSpec::Core::Runner.run([integration_file('rspec')], err, out)
|
15
15
|
|
16
|
-
assert_contains!(out.string, '
|
16
|
+
assert_contains!(out.string, '5 examples, 2 failures')
|
17
17
|
puts "RSpec integration spec passed"
|
18
18
|
end
|
19
19
|
|
data/integration/rspec.rb
CHANGED
@@ -9,7 +9,7 @@ describe RSpec do
|
|
9
9
|
1.should == 1
|
10
10
|
end
|
11
11
|
|
12
|
-
it '
|
12
|
+
it 'does not mind if "should" is in the middle of a string' do
|
13
13
|
1.should == 1
|
14
14
|
end
|
15
15
|
|
@@ -21,19 +21,5 @@ describe RSpec do
|
|
21
21
|
it 'can also pass a normal test' do
|
22
22
|
1.should == 1
|
23
23
|
end
|
24
|
-
|
25
|
-
it 'should also allow should on an "it" through metadata', :should => true do
|
26
|
-
1.should == 1
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
describe 'another nested context', :should => true do
|
31
|
-
it 'can pass yet another normal test' do
|
32
|
-
1.should == 1
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'should not care if a spec starts with should' do
|
36
|
-
1.should == 1
|
37
|
-
end
|
38
24
|
end
|
39
25
|
end
|
data/lib/should_not/rspec.rb
CHANGED
@@ -3,7 +3,6 @@ require 'should_not/constants'
|
|
3
3
|
|
4
4
|
RSpec.configure do |config|
|
5
5
|
config.before(:each) do
|
6
|
-
next if example.metadata[:should] == true
|
7
6
|
# Not sure that last is correct here -- is the array ever larger than one element?
|
8
7
|
description = example.metadata[:description_args].last.to_s
|
9
8
|
fail(ShouldNot::FAILURE_MESSAGE) if description.match(ShouldNot::STARTS_WITH_SHOULD)
|
data/lib/should_not/version.rb
CHANGED
data/should_not.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
`it "ignores nil elements"` - GOOD
|
18
18
|
DESC
|
19
19
|
spec.summary = %q{Fail specs that start with should.}
|
20
|
-
spec.homepage = "https://github.com/
|
20
|
+
spec.homepage = "https://github.com/should-not/should_not"
|
21
21
|
spec.license = "MIT"
|
22
22
|
|
23
23
|
spec.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: should_not
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -89,7 +89,7 @@ files:
|
|
89
89
|
- .rspec
|
90
90
|
- .travis.yml
|
91
91
|
- Gemfile
|
92
|
-
- LICENSE.
|
92
|
+
- LICENSE.MIT
|
93
93
|
- README.md
|
94
94
|
- Rakefile
|
95
95
|
- integration/minitest.rb
|
@@ -102,7 +102,7 @@ files:
|
|
102
102
|
- should_not.gemspec
|
103
103
|
- spec/should_not_spec.rb
|
104
104
|
- spec/spec_helper.rb
|
105
|
-
homepage: https://github.com/
|
105
|
+
homepage: https://github.com/should-not/should_not
|
106
106
|
licenses:
|
107
107
|
- MIT
|
108
108
|
post_install_message:
|
@@ -117,7 +117,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
117
|
version: '0'
|
118
118
|
segments:
|
119
119
|
- 0
|
120
|
-
hash:
|
120
|
+
hash: 3309651739423284020
|
121
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
122
|
none: false
|
123
123
|
requirements:
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
version: '0'
|
127
127
|
segments:
|
128
128
|
- 0
|
129
|
-
hash:
|
129
|
+
hash: 3309651739423284020
|
130
130
|
requirements: []
|
131
131
|
rubyforge_project:
|
132
132
|
rubygems_version: 1.8.25
|