mixlib-authentication 2.0.0 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,55 +0,0 @@
1
- describe "Mixlib::Authentication::Log" do
2
- before do
3
- Mixlib::Authentication.send(:remove_const, "DEFAULT_SERVER_API_VERSION")
4
- Mixlib::Authentication.send(:remove_const, "Log")
5
- end
6
-
7
- context "without mixlib-log" do
8
- before do
9
- @mixlib_path = $LOAD_PATH.find { |p| p.match("mixlib-log") }
10
- $LOAD_PATH.reject! { |p| p.match("mixlib-log") }
11
-
12
- load "mixlib/authentication.rb"
13
- end
14
-
15
- after do
16
- $LOAD_PATH.unshift(@mixlib_path)
17
- end
18
-
19
- it "uses MixlibLogMissing" do
20
- expect(Mixlib::Authentication::Log.singleton_class.included_modules)
21
- .to include(Mixlib::Authentication::NullLogger)
22
- end
23
-
24
- it "default log level is :error" do
25
- expect(Mixlib::Authentication::Log.level).to eq(:error)
26
- end
27
-
28
- %w{trace debug info warn error fatal}.each do |level|
29
- it "logs at level #{level}" do
30
- expect(Mixlib::Authentication::Log).to receive(level).with("foo")
31
-
32
- Mixlib::Authentication.logger.send(level, "foo")
33
- end
34
- end
35
- end
36
-
37
- context "with mixlib-log" do
38
- before do
39
- load "mixlib/authentication.rb"
40
- end
41
-
42
- it "uses Mixlib::Log" do
43
- expect(Mixlib::Authentication::Log.singleton_class.included_modules)
44
- .to include(Mixlib::Log)
45
- end
46
-
47
- %w{trace debug info warn error fatal}.each do |level|
48
- it "forward #{level} to mixlib-log" do
49
- expect_any_instance_of(Mixlib::Log).to receive(level).with("foo")
50
-
51
- Mixlib::Authentication.logger.send(level, "foo")
52
- end
53
- end
54
- end
55
- end
@@ -1,22 +0,0 @@
1
- #
2
- # Author:: Tim Hinderliter (<tim@opscode.com>)
3
- # Author:: Christopher Walters (<cw@opscode.com>)
4
- # Copyright:: Copyright (c) 2009, 2010 Opscode, Inc.
5
- # License:: Apache License, Version 2.0
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
- #
19
-
20
- $:.unshift File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")) # lib in mixlib-authentication
21
-
22
- require "rubygems"