apitools-middleware 0.1.0.pre → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apitools/middleware/spec.rb +1 -0
- data/lib/apitools/middleware/version.rb +1 -1
- data/spec/fixtures/middleware/cache/apitools.json +9 -1
- data/spec/fixtures/middleware/cache/cache.lua +0 -0
- data/spec/local_repository_spec.rb +2 -2
- data/spec/manifest_spec.rb +3 -3
- data/spec/spec_helper.rb +0 -8
- data/spec/spec_spec.rb +21 -4
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3c2e94bd8521a4fc8b4b3376e2db2bdc0315ce7
|
4
|
+
data.tar.gz: 502083a9861a0611900497c7b1afa68729c102e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e0e3c0998981aecc8f46a5c5185920ed7824d9166de2e52e7a297d0d4104cd9fd970b8f6e233d6df9f43de475054734cb7676e61b934442ad9dbe48b6bab341
|
7
|
+
data.tar.gz: eb018ced6b432f495837e5e3474d059662f1648ebcc32995de4e93974b40361bc9964d1179e44ef44e8508d6960490397825bea98a3bd5a9ab76f135347746c6
|
@@ -1,3 +1,11 @@
|
|
1
1
|
{
|
2
|
-
"name"
|
2
|
+
"name": "cache middleware",
|
3
|
+
"description": "cache middleware",
|
4
|
+
"files": ["cache.lua"],
|
5
|
+
"author" : "3scale",
|
6
|
+
"email" : "apitools@apitools.com",
|
7
|
+
"github-user" : "apitools",
|
8
|
+
"version" : "1.0.0",
|
9
|
+
"categories" : ["cache"],
|
10
|
+
"endpoints": ["*"]
|
3
11
|
}
|
File without changes
|
@@ -11,11 +11,11 @@ describe Apitools::Middleware::LocalRepository do
|
|
11
11
|
before do
|
12
12
|
middleware.each {|m| expect(m).to receive(:valid?).and_return(true) }
|
13
13
|
end
|
14
|
-
|
14
|
+
it { is_expected.to be_valid }
|
15
15
|
end
|
16
16
|
|
17
17
|
context 'some middleware is invalid' do
|
18
|
-
|
18
|
+
it { is_expected.to_not be_valid }
|
19
19
|
end
|
20
20
|
|
21
21
|
context 'first middleware' do
|
data/spec/manifest_spec.rb
CHANGED
@@ -2,16 +2,16 @@ describe Apitools::Middleware::Manifest do
|
|
2
2
|
|
3
3
|
context 'invalid manifest' do
|
4
4
|
subject(:invalid_manifest) { described_class.invalid_manifest }
|
5
|
-
|
5
|
+
it { is_expected.to_not be_valid }
|
6
6
|
end
|
7
7
|
|
8
8
|
context 'empty manifest' do
|
9
9
|
subject(:empty_manifest) { described_class.new }
|
10
|
-
|
10
|
+
it { is_expected.to_not be_valid }
|
11
11
|
end
|
12
12
|
|
13
13
|
context 'manifest with something' do
|
14
14
|
subject(:manifest) { described_class.new(value: true) }
|
15
|
-
|
15
|
+
it { is_expected.to be_valid }
|
16
16
|
end
|
17
17
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -74,12 +74,4 @@ RSpec.configure do |config|
|
|
74
74
|
# a real object. This is generally recommended.
|
75
75
|
mocks.verify_partial_doubles = true
|
76
76
|
end
|
77
|
-
|
78
|
-
config.alias_example_to :expect_it
|
79
|
-
end
|
80
|
-
|
81
|
-
RSpec::Core::MemoizedHelpers.module_eval do
|
82
|
-
alias to should
|
83
|
-
alias to_not should_not
|
84
|
-
alias expect_it should # keep rubymine happy
|
85
77
|
end
|
data/spec/spec_spec.rb
CHANGED
@@ -46,8 +46,7 @@ describe Apitools::Middleware::Spec do
|
|
46
46
|
expect(repo).to receive(:content).with(Pathname('some/middleware.lua')).and_return('code')
|
47
47
|
end
|
48
48
|
|
49
|
-
|
50
|
-
|
49
|
+
it { is_expected.to be_valid }
|
51
50
|
|
52
51
|
context 'converted to a hash' do
|
53
52
|
subject(:hash) { spec.to_h }
|
@@ -63,7 +62,7 @@ describe Apitools::Middleware::Spec do
|
|
63
62
|
spec.manifest = {}.to_json
|
64
63
|
end
|
65
64
|
|
66
|
-
|
65
|
+
it { is_expected.to_not be_valid }
|
67
66
|
end
|
68
67
|
|
69
68
|
context 'spec with invalid file' do
|
@@ -72,6 +71,24 @@ describe Apitools::Middleware::Spec do
|
|
72
71
|
expect(repo).to receive(:content)
|
73
72
|
end
|
74
73
|
|
75
|
-
|
74
|
+
it { is_expected.to_not be_valid }
|
75
|
+
end
|
76
|
+
|
77
|
+
context 'spec without files' do
|
78
|
+
let(:manifest) do
|
79
|
+
{
|
80
|
+
name: 'middleware',
|
81
|
+
author: '3scale',
|
82
|
+
description: 'some description',
|
83
|
+
version: '1.2.3-rc.2',
|
84
|
+
endpoints: ['*']
|
85
|
+
}
|
86
|
+
end
|
87
|
+
|
88
|
+
before do
|
89
|
+
spec.manifest = manifest.to_json
|
90
|
+
end
|
91
|
+
|
92
|
+
it { is_expected.to_not be_valid }
|
76
93
|
end
|
77
94
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apitools-middleware
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Cichra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- lib/apitools/middleware/spec.rb
|
90
90
|
- lib/apitools/middleware/version.rb
|
91
91
|
- spec/fixtures/middleware/cache/apitools.json
|
92
|
+
- spec/fixtures/middleware/cache/cache.lua
|
92
93
|
- spec/fixtures/middleware/privacy/apitools.json
|
93
94
|
- spec/fixtures/middleware/test/apitools.json
|
94
95
|
- spec/fixtures/middleware/test/test_file.lua
|
@@ -113,9 +114,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
113
114
|
version: 2.1.2
|
114
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
116
|
requirements:
|
116
|
-
- - "
|
117
|
+
- - ">="
|
117
118
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
119
|
+
version: '0'
|
119
120
|
requirements: []
|
120
121
|
rubyforge_project:
|
121
122
|
rubygems_version: 2.2.2
|
@@ -124,6 +125,7 @@ specification_version: 4
|
|
124
125
|
summary: Ruby Libary for Apitools Middleware
|
125
126
|
test_files:
|
126
127
|
- spec/fixtures/middleware/cache/apitools.json
|
128
|
+
- spec/fixtures/middleware/cache/cache.lua
|
127
129
|
- spec/fixtures/middleware/privacy/apitools.json
|
128
130
|
- spec/fixtures/middleware/test/apitools.json
|
129
131
|
- spec/fixtures/middleware/test/test_file.lua
|