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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee3ae57c879757cb9b3cdfb15b3948992e354898
4
- data.tar.gz: 8fcadbd213b8ae54dab35f79634559905d2e0458
3
+ metadata.gz: b3c2e94bd8521a4fc8b4b3376e2db2bdc0315ce7
4
+ data.tar.gz: 502083a9861a0611900497c7b1afa68729c102e3
5
5
  SHA512:
6
- metadata.gz: cafba3753e2021015739f1ac8f4dec7d86776c85670b5aa333a04b893254fba42d93fbe9b666b0d68c2189e4d4bed20ef406ac755caf3a3362aa82f14fe1bcd2
7
- data.tar.gz: 5b7d549c53d53e82462d4155825794377c62a35a2a86857ac7653f8c40906b653af010ae793c615557e411a667104a98f4be30b8af6a553b097986ef1cc45ea6
6
+ metadata.gz: 1e0e3c0998981aecc8f46a5c5185920ed7824d9166de2e52e7a297d0d4104cd9fd970b8f6e233d6df9f43de475054734cb7676e61b934442ad9dbe48b6bab341
7
+ data.tar.gz: eb018ced6b432f495837e5e3474d059662f1648ebcc32995de4e93974b40361bc9964d1179e44ef44e8508d6960490397825bea98a3bd5a9ab76f135347746c6
@@ -72,6 +72,7 @@ module Apitools
72
72
  return unless required_attributes.all?
73
73
 
74
74
  lua_files = Array(files).map { |file| content(file) }
75
+ return if lua_files.empty?
75
76
  lua_files.none?{ |file| !file || file.nil? || file.empty? }
76
77
  end
77
78
 
@@ -1,5 +1,5 @@
1
1
  module Apitools
2
2
  module Middleware
3
- VERSION = '0.1.0.pre'
3
+ VERSION = '0.1.0'
4
4
  end
5
5
  end
@@ -1,3 +1,11 @@
1
1
  {
2
- "name" : "cache middleware"
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
  }
@@ -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
- expect_it { to be_valid }
14
+ it { is_expected.to be_valid }
15
15
  end
16
16
 
17
17
  context 'some middleware is invalid' do
18
- expect_it { to_not be_valid }
18
+ it { is_expected.to_not be_valid }
19
19
  end
20
20
 
21
21
  context 'first middleware' do
@@ -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
- expect_it { to_not be_valid }
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
- expect_it { to_not be_valid }
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
- expect_it { to be_valid }
15
+ it { is_expected.to be_valid }
16
16
  end
17
17
  end
@@ -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
@@ -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
- expect_it { to be_valid }
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
- expect_it { to_not be_valid }
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
- expect_it { to_not be_valid }
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.pre
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-04 00:00:00.000000000 Z
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: 1.3.1
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