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 +3 -0
- data/VERSION.yml +2 -2
- data/bin/run_celerity_server.rb +4 -0
- data/culerity.gemspec +6 -3
- data/features/step_definitions/rails_setup_steps.rb +1 -0
- data/lib/culerity.rb +5 -7
- data/lib/culerity/celerity_server.rb +6 -0
- data/lib/culerity/persistent_delivery.rb +1 -1
- data/lib/culerity/remote_object_proxy.rb +2 -2
- data/rails_generators/culerity/templates/features/step_definitions/culerity_steps.rb +15 -8
- data/spec/remote_object_proxy_spec.rb +12 -0
- metadata +28 -16
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)
|
data/VERSION.yml
CHANGED
data/culerity.gemspec
CHANGED
@@ -5,13 +5,15 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{culerity}
|
8
|
-
s.version = "0.2.
|
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-
|
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.
|
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
|
data/lib/culerity.rb
CHANGED
@@ -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(
|
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
|
@@ -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
|
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
|
-
$
|
4
|
+
$rails_server_pid ||= Culerity::run_rails(:environment => 'culerity', :port => 3001)
|
5
5
|
$server ||= Culerity::run_server
|
6
|
-
|
7
|
-
:
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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, $
|
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
|
-
|
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-
|
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
|
-
|
18
|
-
|
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
|
-
|
30
|
+
type: :development
|
31
|
+
version_requirements: *id001
|
25
32
|
- !ruby/object:Gem::Dependency
|
26
33
|
name: rspec
|
27
|
-
|
28
|
-
|
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
|
-
|
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.
|
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.
|