cross-stub 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/.infinity_test ADDED
@@ -0,0 +1,40 @@
1
+ # Hacking RVM
2
+ module RVM
3
+ module Shell
4
+ class AbstractWrapper
5
+ def raw_stdout_to_parts(c)
6
+ raise IncompleteCommandError if !command_complete?(c)
7
+ before, after = c.split(COMMAND_EPILOG_START, 2)
8
+ epilog, after = after.split(COMMAND_EPILOG_END, 2)
9
+ # HACK .. need to apply gsub to prevent yaml-related error
10
+ return before, YAML.load(epilog.strip.gsub("\\\"\n","\"\n")), after
11
+ end
12
+ end
13
+ end
14
+ end
15
+
16
+ # See http://github.com/tomas-stefano/infinity_test/wiki/Customize-Infinity-Test
17
+ infinity_test do
18
+
19
+ # Sets bacon mute to avoid excessive noise that makes it hard to pinpoint errors
20
+ ENV['MUTE_BACON'] = 'true'
21
+
22
+ use \
23
+ :test_framework => :bacon,
24
+ :rubies => %w(
25
+ ruby-1.8.6-p399@parsetree
26
+ ruby-1.8.7-p302
27
+ ree-1.8.7-2010.02
28
+ ruby-1.9.2-p0
29
+ jruby-1.5.3
30
+ )
31
+ # NOTE: Right now, 1.9.1 fails due to a marshalling bug.
32
+ # :rubies => %w(
33
+ # ruby-1.8.6-p399@parsetree
34
+ # ruby-1.8.7-p302
35
+ # ree-1.8.7-2010.02
36
+ # ruby-1.9.1-p378
37
+ # ruby-1.9.2-p0
38
+ # jruby-1.5.3
39
+ # )
40
+ end
data/HISTORY.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 0.2.3 (Oct 16, 2010)
2
+
3
+ * adds official support for MRI-1.9.2 [#ngty]
4
+ * more accurate extracting of proc code (with the latest sourcify release) [#ngty]
5
+
1
6
  === 0.2.2 (Sep 16, 2010)
2
7
 
3
8
  = Bugfixes
data/README.rdoc CHANGED
@@ -147,12 +147,12 @@ if u need more :]
147
147
  == Caveats
148
148
 
149
149
  #1. CrossStub uses ruby's Marshal class to dump & load the stubs, thus it has the
150
- same limitations as Marshal (pls note abt a 1.9.1 specific marshal bug at
151
- http://redmine.ruby-lang.org/issues/show/3729)
150
+ same limitations as Marshal (pls note abt a 1.9.1 specific marshal bug at
151
+ http://redmine.ruby-lang.org/issues/show/3729)
152
152
 
153
153
  #2. Under the hood, CrossStub uses Sourcify (http://github.com/ngty/sourcify) for
154
- extracting the methods defined within the proc, u may wish to read Sourcify's
155
- gotchas to avoid unnecessary headaches.
154
+ extracting the methods defined within the proc, u may wish to read Sourcify's
155
+ gotchas to avoid unnecessary headaches.
156
156
 
157
157
  == TODO(s)
158
158
 
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ begin
15
15
  gem.add_development_dependency "otaku", ">= 0.4.0"
16
16
  gem.add_dependency "ruby2ruby", ">= 1.2.5"
17
17
  gem.add_dependency "sexp_processor", ">= 3.0.5"
18
- gem.add_dependency "sourcify", ">= 0.2.3"
18
+ gem.add_dependency "sourcify", ">= 0.4.0"
19
19
  gem.required_ruby_version = '>= 1.8.6'
20
20
  # TODO: How do we declare the following optional dependencies ??
21
21
  # 1. gem.add_dependency "memcache-client", "= 1.8.5"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
data/cross-stub.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cross-stub}
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["NgTzeYang"]
12
- s.date = %q{2010-09-16}
12
+ s.date = %q{2010-10-16}
13
13
  s.description = %q{}
14
14
  s.email = %q{ngty77@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.files = [
20
20
  ".document",
21
21
  ".gitignore",
22
+ ".infinity_test",
22
23
  "HISTORY.txt",
23
24
  "LICENSE",
24
25
  "README.rdoc",
@@ -80,20 +81,20 @@ Gem::Specification.new do |s|
80
81
  s.add_development_dependency(%q<otaku>, [">= 0.4.0"])
81
82
  s.add_runtime_dependency(%q<ruby2ruby>, [">= 1.2.5"])
82
83
  s.add_runtime_dependency(%q<sexp_processor>, [">= 3.0.5"])
83
- s.add_runtime_dependency(%q<sourcify>, [">= 0.2.3"])
84
+ s.add_runtime_dependency(%q<sourcify>, [">= 0.4.0"])
84
85
  else
85
86
  s.add_dependency(%q<bacon>, [">= 0.0.0"])
86
87
  s.add_dependency(%q<otaku>, [">= 0.4.0"])
87
88
  s.add_dependency(%q<ruby2ruby>, [">= 1.2.5"])
88
89
  s.add_dependency(%q<sexp_processor>, [">= 3.0.5"])
89
- s.add_dependency(%q<sourcify>, [">= 0.2.3"])
90
+ s.add_dependency(%q<sourcify>, [">= 0.4.0"])
90
91
  end
91
92
  else
92
93
  s.add_dependency(%q<bacon>, [">= 0.0.0"])
93
94
  s.add_dependency(%q<otaku>, [">= 0.4.0"])
94
95
  s.add_dependency(%q<ruby2ruby>, [">= 1.2.5"])
95
96
  s.add_dependency(%q<sexp_processor>, [">= 3.0.5"])
96
- s.add_dependency(%q<sourcify>, [">= 0.2.3"])
97
+ s.add_dependency(%q<sourcify>, [">= 0.4.0"])
97
98
  end
98
99
  end
99
100
 
@@ -7,12 +7,18 @@ module CrossStub
7
7
 
8
8
  def parse(&block)
9
9
  methods = {}
10
- block.to_sexp.each_of_type(:defn) do |_sexp|
10
+ proc_to_sexp(block).each_of_type(:defn) do |_sexp|
11
11
  methods[_sexp.to_a[1]] = RUBY_2_RUBY.process(_sexp)
12
12
  end
13
13
  methods
14
14
  end
15
15
 
16
+ def proc_to_sexp(block)
17
+ block.to_sexp(:stip_enclosure => true, :attached_to => :xstub) do |body|
18
+ body =~ /^(.*\W|)def\W/
19
+ end
20
+ end
21
+
16
22
  end
17
23
  end
18
24
  end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'shared_spec')
1
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'shared_spec')
2
2
 
3
3
  describe 'Clearing Instance Stubs' do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'shared_spec')
1
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'shared_spec')
2
2
 
3
3
  describe 'Clearing Stubs' do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'shared_spec')
1
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'shared_spec')
2
2
 
3
3
  describe 'Creating Instance Stubs' do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'shared_spec')
1
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'shared_spec')
2
2
 
3
3
  describe 'Creating Stubs' do
4
4
 
@@ -1,5 +1,5 @@
1
- require File.join(File.dirname(__FILE__), '..', 'spec_helper')
2
- require File.join(File.dirname(__FILE__), '..', 'includes')
1
+ require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'spec_helper')
2
+ require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'includes')
3
3
 
4
4
  shared 'has standard setup' do
5
5
  before { CrossStub.setup(cache_store(@store_type)) }
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'shared_spec')
1
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'shared_spec')
2
2
 
3
3
  describe 'Stubbing Error' do
4
4
 
data/spec/spec_helper.rb CHANGED
@@ -2,4 +2,22 @@ require 'rubygems'
2
2
  require 'bacon'
3
3
  require File.join(File.dirname(__FILE__), 'includes')
4
4
 
5
+ Bacon.extend(Bacon::TestUnitOutput)
5
6
  Bacon.summary_on_exit
7
+
8
+ if ENV['MUTE_BACON'] == 'true'
9
+ Bacon.extend(Module.new {
10
+
11
+ def handle_requirement(description)
12
+ unless (error = yield).empty?
13
+ print error[0..0]
14
+ end
15
+ end
16
+
17
+ def handle_summary
18
+ puts "", " %d tests, %d assertions, %d failures, %d errors" %
19
+ Bacon::Counter.values_at(:specifications, :requirements, :failed, :errors)
20
+ end
21
+
22
+ })
23
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cross-stub
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - NgTzeYang
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-16 00:00:00 +08:00
18
+ date: 2010-10-16 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -90,12 +90,12 @@ dependencies:
90
90
  requirements:
91
91
  - - ">="
92
92
  - !ruby/object:Gem::Version
93
- hash: 17
93
+ hash: 15
94
94
  segments:
95
95
  - 0
96
- - 2
97
- - 3
98
- version: 0.2.3
96
+ - 4
97
+ - 0
98
+ version: 0.4.0
99
99
  type: :runtime
100
100
  version_requirements: *id005
101
101
  description: ""
@@ -110,6 +110,7 @@ extra_rdoc_files:
110
110
  files:
111
111
  - .document
112
112
  - .gitignore
113
+ - .infinity_test
113
114
  - HISTORY.txt
114
115
  - LICENSE
115
116
  - README.rdoc