culerity 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.9
2
+ * fixed memory leaks within the java process by clearing proxies (dewind)
3
+ * fixed syntax error when sending multiline lambdas (endor, langalex)
4
+
1
5
  ## 0.2.8
2
6
 
3
7
  * removed separate development and continuous integration environments and replaced them with a single one (thilo)
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- :build:
3
- :patch: 8
4
2
  :major: 0
3
+ :build:
5
4
  :minor: 2
5
+ :patch: 9
data/culerity.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{culerity}
8
- s.version = "0.2.8"
8
+ s.version = "0.2.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexander Lang"]
12
- s.date = %q{2010-02-06}
12
+ s.date = %q{2010-02-19}
13
13
  s.description = %q{Culerity integrates Cucumber and Celerity in order to test your application's full stack.}
14
14
  s.email = %q{alex@upstream-berlin.com}
15
15
  s.extra_rdoc_files = [
@@ -41,6 +41,7 @@ module Culerity
41
41
  def close_browsers
42
42
  @browsers.each { |browser| browser.close }
43
43
  @browsers = []
44
+ @proxies = {}
44
45
  end
45
46
 
46
47
  def browser(number)
@@ -63,7 +64,7 @@ module Culerity
63
64
  def proxify(result)
64
65
  if result.is_a?(Array)
65
66
  "[" + result.map {|x| proxify(x) }.join(", ") + "]"
66
- elsif [String, TrueClass, FalseClass, Fixnum, Float, NilClass].include?(result.class)
67
+ elsif [Symbol, String, TrueClass, FalseClass, Fixnum, Float, NilClass].include?(result.class)
67
68
  result.inspect
68
69
  else
69
70
  @proxies[result.object_id] = result
@@ -63,10 +63,10 @@ module Culerity
63
63
  #
64
64
  def block_to_string &block
65
65
  result = block.call.to_s
66
- unless result.is_a?(String) && result[/^lambda \s* \{ .*? \}/x]
66
+ unless result.is_a?(String) && result[/^lambda \s* \{ .*? \}/xm]
67
67
  result = "lambda { #{result} }"
68
68
  end
69
- result
69
+ result.gsub("\n", ";")
70
70
  end
71
71
 
72
72
  def arg_to_string(arg)
@@ -79,7 +79,16 @@ describe Culerity::CelerityServer do
79
79
  Culerity::CelerityServer.new(_in, _out)
80
80
  end
81
81
 
82
- it "should send back a proxy if the return value is not a string, number, nil or boolean" do
82
+ it "should send back a symbol" do
83
+ @browser.stub!(:goto).and_return(:ok)
84
+ _in = stub 'in'
85
+ _in.stub!(:gets).and_return("[[\"browser0\", \"goto\"]]\n", "[\"_exit_\"]\n")
86
+ _out = stub 'out'
87
+ _out.should_receive(:<<).with("[:return, :ok]\n")
88
+ Culerity::CelerityServer.new(_in, _out)
89
+ end
90
+
91
+ it "should send back a proxy if the return value is not a string, number, nil, symbol or boolean" do
83
92
  @browser.stub!(:goto).and_return(stub('123', :object_id => 456))
84
93
  _in = stub 'in'
85
94
  _in.stub!(:gets).and_return("[[\"browser0\", \"goto\", \"/homepage\"]]\n", "[\"_exit_\"]\n")
@@ -8,6 +8,12 @@ describe Culerity::RemoteObjectProxy do
8
8
  proxy.send(:block_to_string, &block).should == "lambda { true}"
9
9
  end
10
10
 
11
+ it "should replace newlines in lambda string with semicolons so that the server can parse it as one command" do
12
+ proxy = Culerity::RemoteObjectProxy.new nil, nil
13
+ block = lambda { "lambda { \ntrue\n}" }
14
+ proxy.send(:block_to_string, &block).should == "lambda { ;true;}"
15
+ end
16
+
11
17
  it "should return lambda string when block result isn't a lambda string" do
12
18
  proxy = Culerity::RemoteObjectProxy.new nil, nil
13
19
  [true, false, "blah", 5].each do |var|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: culerity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Lang
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-06 00:00:00 +01:00
12
+ date: 2010-02-19 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency