mcollective-test 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/mcollective/test/util.rb +18 -16
  2. metadata +8 -8
@@ -9,7 +9,7 @@ module MCollective
9
9
  facts.stubs(:get_fact).with(k).returns(v)
10
10
  end
11
11
 
12
- MCollective::PluginManager << {:type => "facts_plugin", :class => facts, :single_instance => false}
12
+ PluginManager << {:type => "facts_plugin", :class => facts, :single_instance => false}
13
13
  end
14
14
 
15
15
  def create_config_mock(config)
@@ -44,14 +44,14 @@ module MCollective
44
44
  end
45
45
 
46
46
 
47
- MCollective::Config.stubs(:instance).returns(cfg)
47
+ Config.stubs(:instance).returns(cfg)
48
48
 
49
49
  cfg
50
50
  end
51
51
 
52
52
  def mock_validators
53
- MCollective::Validator.stubs(:load_validators)
54
- MCollective::Validator.stubs(:validate).returns(true)
53
+ Validator.stubs(:load_validators)
54
+ Validator.stubs(:validate).returns(true)
55
55
  end
56
56
 
57
57
  def create_logger_mock
@@ -61,7 +61,9 @@ module MCollective
61
61
  logger.stubs(meth)
62
62
  end
63
63
 
64
- MCollective::Log.configure(logger)
64
+ Log.stubs(:config_and_check_level).returns(false)
65
+
66
+ Log.configure(logger)
65
67
 
66
68
  logger
67
69
  end
@@ -73,45 +75,45 @@ module MCollective
73
75
  connector.stubs(meth)
74
76
  end
75
77
 
76
- MCollective::PluginManager << {:type => "connector_plugin", :class => connector}
78
+ PluginManager << {:type => "connector_plugin", :class => connector}
77
79
 
78
80
  connector
79
81
  end
80
82
 
81
83
  def load_application(application, application_file=nil)
82
84
  classname = "MCollective::Application::#{application.capitalize}"
83
- MCollective::PluginManager.delete("#{application}_application")
85
+ PluginManager.delete("#{application}_application")
84
86
 
85
87
  if application_file
86
88
  raise "Cannot find application file #{application_file} for application #{application}" unless File.exist?(application_file)
87
89
  load application_file
88
90
  else
89
- MCollective::PluginManager.loadclass(classname)
91
+ PluginManager.loadclass(classname)
90
92
  end
91
93
 
92
- MCollective::PluginManager << {:type => "#{application}_application", :class => classname, :single_instance => false}
93
- MCollective::PluginManager["#{application}_application"]
94
+ PluginManager << {:type => "#{application}_application", :class => classname, :single_instance => false}
95
+ PluginManager["#{application}_application"]
94
96
  end
95
97
 
96
98
  def load_agent(agent, agent_file=nil)
97
99
  classname = "MCollective::Agent::#{agent.capitalize}"
98
100
 
99
- MCollective::PluginManager.delete("#{agent}_agent")
101
+ PluginManager.delete("#{agent}_agent")
100
102
 
101
103
  if agent_file
102
104
  raise "Cannot find agent file #{agent_file} for agent #{agent}" unless File.exist?(agent_file)
103
105
  load agent_file
104
106
  else
105
- MCollective::PluginManager.loadclass(classname)
107
+ PluginManager.loadclass(classname)
106
108
  end
107
109
 
108
- klass = MCollective::Agent.const_get(agent.capitalize)
110
+ klass = Agent.const_get(agent.capitalize)
109
111
 
110
112
  klass.any_instance.stubs("load_ddl").returns(true)
111
- MCollective::RPC::Request.any_instance.stubs(:validate!).returns(true)
113
+ RPC::Request.any_instance.stubs(:validate!).returns(true)
112
114
 
113
- MCollective::PluginManager << {:type => "#{agent}_agent", :class => classname, :single_instance => false}
114
- MCollective::PluginManager["#{agent}_agent"]
115
+ PluginManager << {:type => "#{agent}_agent", :class => classname, :single_instance => false}
116
+ PluginManager["#{agent}_agent"]
115
117
  end
116
118
 
117
119
  def create_response(senderid, data = {}, stats = nil , statuscode = 0, statusmsg = "OK")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcollective-test
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - R.I.Pienaar
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-01-10 00:00:00 +00:00
18
+ date: 2013-02-11 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -29,16 +29,16 @@ extra_rdoc_files: []
29
29
 
30
30
  files:
31
31
  - lib/mcollective/test.rb
32
+ - lib/mcollective/test/application_test.rb
33
+ - lib/mcollective/test/data_test.rb
32
34
  - lib/mcollective/test/local_agent_test.rb
33
35
  - lib/mcollective/test/matchers.rb
34
- - lib/mcollective/test/remote_agent_test.rb
35
- - lib/mcollective/test/data_test.rb
36
+ - lib/mcollective/test/matchers/application_description.rb
36
37
  - lib/mcollective/test/matchers/rpc_metadata.rb
37
38
  - lib/mcollective/test/matchers/rpc_result_items.rb
38
39
  - lib/mcollective/test/matchers/rpc_status.rb
39
- - lib/mcollective/test/matchers/application_description.rb
40
+ - lib/mcollective/test/remote_agent_test.rb
40
41
  - lib/mcollective/test/util.rb
41
- - lib/mcollective/test/application_test.rb
42
42
  has_rdoc: true
43
43
  homepage: https://github.com/ripienaar/mcollective-test/
44
44
  licenses: []