culerity 0.2.9 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.2.10
2
+ * another speed improvement by only clearing cookies instead of closing browsers after each scenario (dewind)
3
+
1
4
  ## 0.2.9
2
5
  * fixed memory leaks within the java process by clearing proxies (dewind)
3
6
  * fixed syntax error when sending multiline lambdas (endor, langalex)
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
- :build:
4
3
  :minor: 2
5
- :patch: 9
4
+ :patch: 10
5
+ :build:
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env jruby
2
+ require File.dirname(__FILE__) << '/../lib/culerity/celerity_server'
3
+ Culerity::CelerityServer.new(STDIN, STDOUT)
4
+
@@ -5,13 +5,15 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{culerity}
8
- s.version = "0.2.9"
8
+ s.version = "0.2.10"
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-19}
12
+ s.date = %q{2010-04-28}
13
+ s.default_executable = %q{run_celerity_server.rb}
13
14
  s.description = %q{Culerity integrates Cucumber and Celerity in order to test your application's full stack.}
14
15
  s.email = %q{alex@upstream-berlin.com}
16
+ s.executables = ["run_celerity_server.rb"]
15
17
  s.extra_rdoc_files = [
16
18
  "README.md"
17
19
  ]
@@ -22,6 +24,7 @@ Gem::Specification.new do |s|
22
24
  "README.md",
23
25
  "Rakefile",
24
26
  "VERSION.yml",
27
+ "bin/run_celerity_server.rb",
25
28
  "culerity.gemspec",
26
29
  "features/fixtures/jquery",
27
30
  "features/fixtures/sample_feature",
@@ -61,7 +64,7 @@ Gem::Specification.new do |s|
61
64
  s.homepage = %q{http://github.com/langalex/culerity}
62
65
  s.rdoc_options = ["--charset=UTF-8"]
63
66
  s.require_paths = ["lib"]
64
- s.rubygems_version = %q{1.3.5}
67
+ s.rubygems_version = %q{1.3.6}
65
68
  s.summary = %q{Culerity integrates Cucumber and Celerity in order to test your application's full stack.}
66
69
  s.test_files = [
67
70
  "spec/celerity_server_spec.rb",
@@ -16,6 +16,7 @@ Given /^culerity is installed as a plugin$/ do
16
16
  `cp -rf #{File.dirname(__FILE__) + "/../../lib"} #{File.join(@active_project_folder, plugin_folder)}`
17
17
  `cp -rf #{File.dirname(__FILE__) + "/../../rails"} #{File.join(@active_project_folder, plugin_folder)}`
18
18
  `cp -rf #{File.dirname(__FILE__) + "/../../init.rb"} #{File.join(@active_project_folder, plugin_folder)}`
19
+ `cp -rf #{File.dirname(__FILE__) + "/../../bin"} #{File.join(@active_project_folder, plugin_folder)}`
19
20
  end
20
21
 
21
22
  When /^I add a feature file to test Rails index.html default file$/ do
@@ -18,10 +18,14 @@ module Culerity
18
18
  def close_browsers
19
19
  self.puts '["_close_browsers_"]'
20
20
  end
21
+
22
+ def clear_proxies
23
+ self.puts '["_clear_proxies_"]'
24
+ end
21
25
  end
22
26
 
23
27
  def self.run_server
24
- IO.popen("jruby #{__FILE__}", 'r+').extend(ServerCommands)
28
+ IO.popen(File.dirname(__FILE__) + "/../bin/run_celerity_server.rb", 'r+').extend(ServerCommands)
25
29
  end
26
30
 
27
31
  def self.run_rails(options = {})
@@ -42,9 +46,3 @@ module Culerity
42
46
  end
43
47
  end
44
48
  end
45
-
46
- if __FILE__ == $0
47
- require File.dirname(__FILE__) + '/culerity/celerity_server'
48
- Culerity::CelerityServer.new STDIN, STDOUT
49
- end
50
-
@@ -13,6 +13,8 @@ module Culerity
13
13
  call, block = eval _in.gets.to_s.strip
14
14
  return if call == "_exit_"
15
15
  next(close_browsers) if call == "_close_browsers_"
16
+ next(clear_proxies) if call == "_clear_proxies_"
17
+
16
18
  unless call.nil?
17
19
  begin
18
20
  result = target(call.first).send call[1], *call[2..-1], &block
@@ -28,6 +30,10 @@ module Culerity
28
30
 
29
31
  private
30
32
 
33
+ def clear_proxies
34
+ @proxies = {}
35
+ end
36
+
31
37
  def configure_browser(options)
32
38
  @browser_options = options
33
39
  end
@@ -31,5 +31,5 @@ module Culerity
31
31
  end
32
32
  end
33
33
 
34
- ActionMailer::Base.send :include, Culerity::PersistentDelivery
34
+ ActionMailer::Base.send :include, Culerity::PersistentDelivery if defined?(ActionMailer)
35
35
 
@@ -62,8 +62,8 @@ module Culerity
62
62
  # Returns a string in the format "lambda { … }"
63
63
  #
64
64
  def block_to_string &block
65
- result = block.call.to_s
66
- unless result.is_a?(String) && result[/^lambda \s* \{ .*? \}/xm]
65
+ result = block.call.to_s.strip
66
+ unless result.is_a?(String) && result[/^lambda\s*(\{|do).+(\}|end)/xm]
67
67
  result = "lambda { #{result} }"
68
68
  end
69
69
  result.gsub("\n", ";")
@@ -1,21 +1,28 @@
1
1
  require 'culerity'
2
2
 
3
3
  Before do
4
- $rails_server ||= Culerity::run_rails(:environment => 'culerity', :port => 3001)
4
+ $rails_server_pid ||= Culerity::run_rails(:environment => 'culerity', :port => 3001)
5
5
  $server ||= Culerity::run_server
6
- $browser = Culerity::RemoteBrowserProxy.new $server, {:browser => :firefox3,
7
- :javascript_exceptions => true,
8
- :resynchronize => true,
9
- :status_code_exceptions => true
10
- }
11
- $browser.log_level = :warning
6
+ unless $browser
7
+ $browser = Culerity::RemoteBrowserProxy.new $server, {:browser => :firefox3,
8
+ :javascript_exceptions => true,
9
+ :resynchronize => true,
10
+ :status_code_exceptions => true
11
+ }
12
+ $browser.log_level = :warning
13
+ end
12
14
  @host = 'http://localhost:3001'
13
15
  end
14
16
 
17
+ After do
18
+ $server.clear_proxies
19
+ $browser.clear_cookies
20
+ end
21
+
15
22
  at_exit do
16
23
  $browser.exit if $browser
17
24
  $server.close if $server
18
- Process.kill(6, $rails_server.pid.to_i) if $rails_server
25
+ Process.kill(6, $rails_server_pid) if $rails_server_pid
19
26
  end
20
27
 
21
28
  Given /^(?:|I )am on (.+)$/ do |page_name|
@@ -13,6 +13,18 @@ describe Culerity::RemoteObjectProxy do
13
13
  block = lambda { "lambda { \ntrue\n}" }
14
14
  proxy.send(:block_to_string, &block).should == "lambda { ;true;}"
15
15
  end
16
+
17
+ it "should accept do end in lambda string instead of {}" do
18
+ code = <<-CODE
19
+ lambda do |page, message|
20
+ true
21
+ end
22
+ CODE
23
+
24
+ proxy = Culerity::RemoteObjectProxy.new nil, nil
25
+ block = lambda { code }
26
+ proxy.send(:block_to_string, &block).should == "lambda do |page, message|; true; end"
27
+ end
16
28
 
17
29
  it "should return lambda string when block result isn't a lambda string" do
18
30
  proxy = Culerity::RemoteObjectProxy.new nil, nil
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: culerity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 10
9
+ version: 0.2.10
5
10
  platform: ruby
6
11
  authors:
7
12
  - Alexander Lang
@@ -9,33 +14,37 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-19 00:00:00 +01:00
13
- default_executable:
17
+ date: 2010-04-28 00:00:00 +02:00
18
+ default_executable: run_celerity_server.rb
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: cucumber
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
23
29
  version: "0"
24
- version:
30
+ type: :development
31
+ version_requirements: *id001
25
32
  - !ruby/object:Gem::Dependency
26
33
  name: rspec
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
34
+ prerelease: false
35
+ requirement: &id002 !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
39
+ segments:
40
+ - 0
33
41
  version: "0"
34
- version:
42
+ type: :development
43
+ version_requirements: *id002
35
44
  description: Culerity integrates Cucumber and Celerity in order to test your application's full stack.
36
45
  email: alex@upstream-berlin.com
37
- executables: []
38
-
46
+ executables:
47
+ - run_celerity_server.rb
39
48
  extensions: []
40
49
 
41
50
  extra_rdoc_files:
@@ -47,6 +56,7 @@ files:
47
56
  - README.md
48
57
  - Rakefile
49
58
  - VERSION.yml
59
+ - bin/run_celerity_server.rb
50
60
  - culerity.gemspec
51
61
  - features/fixtures/jquery
52
62
  - features/fixtures/sample_feature
@@ -95,18 +105,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
105
  requirements:
96
106
  - - ">="
97
107
  - !ruby/object:Gem::Version
108
+ segments:
109
+ - 0
98
110
  version: "0"
99
- version:
100
111
  required_rubygems_version: !ruby/object:Gem::Requirement
101
112
  requirements:
102
113
  - - ">="
103
114
  - !ruby/object:Gem::Version
115
+ segments:
116
+ - 0
104
117
  version: "0"
105
- version:
106
118
  requirements: []
107
119
 
108
120
  rubyforge_project:
109
- rubygems_version: 1.3.5
121
+ rubygems_version: 1.3.6
110
122
  signing_key:
111
123
  specification_version: 3
112
124
  summary: Culerity integrates Cucumber and Celerity in order to test your application's full stack.