fake_execution 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,8 @@
1
1
  Fake Execution
2
2
  ======
3
3
 
4
- [![Build Status](https://secure.travis-ci.org/josephwilk/fake-execution.png)](http://travis-ci.org/josephwilk/fake-execution)
4
+ [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/josephwilk/fake_execution)
5
+ [![Build Status](https://secure.travis-ci.org/josephwilk/fake_execution.png)](http://travis-ci.org/josephwilk/fake_execution)
5
6
 
6
7
 
7
8
  Execution, but... like... fake.
@@ -15,14 +15,17 @@ module FakeExecution
15
15
 
16
16
  def self.deactivate!
17
17
  Kernel.class_eval do
18
- alias_method :fake_backtick, :`
19
- alias_method :`, :real_backtick
18
+ # Have we been activated?
19
+ if method_defined?(:real_backtick)
20
+ alias_method :fake_backtick, :`
21
+ alias_method :`, :real_backtick
20
22
 
21
- alias_method :fake_system, :system
22
- alias_method :system, :real_system
23
+ alias_method :fake_system, :system
24
+ alias_method :system, :real_system
23
25
 
24
- alias_method :fake_exec, :exec
25
- alias_method :exec, :real_exec
26
+ alias_method :fake_exec, :exec
27
+ alias_method :exec, :real_exec
28
+ end
26
29
  end
27
30
  true
28
31
  end
@@ -1,6 +1,10 @@
1
1
  Kernel.class_eval do
2
2
  attr_reader :cmds
3
3
 
4
+ def reset_cmds!
5
+ @cmds = []
6
+ end
7
+
4
8
  def fake_backtick(cmd)
5
9
  @cmds ||= []
6
10
  @cmds << cmd
metadata CHANGED
@@ -1,86 +1,68 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: fake_execution
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 0
9
- - 2
10
- version: 0.0.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Joseph Wilk
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-12-09 00:00:00 +00:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2012-08-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: rspec
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
33
22
  type: :development
34
- version_requirements: *id001
35
- description: "Fake out execution in Ruby and instead of running them log them. Allows inspection of the commands that where executed. "
36
- email:
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: ! 'Fake out execution in Ruby and instead of running them log them. Allows
31
+ inspection of the commands that where executed. '
32
+ email:
37
33
  - joe@josephwilk.net
38
34
  executables: []
39
-
40
35
  extensions: []
41
-
42
36
  extra_rdoc_files: []
43
-
44
- files:
45
- - lib/fake_execution.rb
37
+ files:
38
+ - lib/fake_execution/base.rb
46
39
  - lib/fake_execution/kernel.rb
47
40
  - lib/fake_execution/safe.rb
48
- - lib/fake_execution/base.rb
49
41
  - lib/fake_execution/spec_helpers.rb
42
+ - lib/fake_execution.rb
50
43
  - Readme.markdown
51
- has_rdoc: true
52
44
  homepage: http://github.com/josephwilk/fake_execution
53
45
  licenses: []
54
-
55
46
  post_install_message:
56
47
  rdoc_options: []
57
-
58
- require_paths:
48
+ require_paths:
59
49
  - lib
60
- required_ruby_version: !ruby/object:Gem::Requirement
50
+ required_ruby_version: !ruby/object:Gem::Requirement
61
51
  none: false
62
- requirements:
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- hash: 3
66
- segments:
67
- - 0
68
- version: "0"
69
- required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
57
  none: false
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- hash: 3
75
- segments:
76
- - 0
77
- version: "0"
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
78
62
  requirements: []
79
-
80
63
  rubyforge_project:
81
- rubygems_version: 1.3.7
64
+ rubygems_version: 1.8.24
82
65
  signing_key:
83
66
  specification_version: 3
84
67
  summary: Fake out execution in Ruby to make testing easier
85
68
  test_files: []
86
-