Permalink
Browse files

Adapted to ruote 2.1.12 : Parser -> Reader

(patch by Chris Buben)
  • Loading branch information...
1 parent cf6d95b commit 8a3565d30d1c3cba81b065c70dd95a75fd902517 @jmettraux jmettraux committed Jan 25, 2011
Showing with 65 additions and 51 deletions.
  1. +6 −1 CHANGELOG.txt
  2. +5 −4 CREDITS.txt
  3. +2 −2 Gemfile
  4. +3 −0 TODO.txt
  5. +3 −2 spec/resources/errors_spec.rb
  6. +20 −19 spec/resources/expressions_spec.rb
  7. +2 −2 spec/resources/schedules_spec.rb
  8. +24 −21 spec/resources/workitems_spec.rb
View
@@ -2,7 +2,12 @@
= ruote-kit - CHANGELOG.txt
-== ruote-kit - 2.1.11 not yet released
+== ruote-kit - 2.1.12 not yet released
+
+- Adapted to ruote 2.1.12 : Parser -> Reader (patch by Chris Buben)
+
+
+== ruote-kit - 2.1.11 not released
- RuoteKit.run_worker(storage) will not return (since it will let the worker
run in the current thread)
View
@@ -4,12 +4,13 @@
== Main project team
-- Kenneth Kalmer (http://opensourcery.co.za/)
-- Torsten Schönebaum (http://www.torstenschoenebaum.de)
-- John Mettraux (http://jmettraux.wordpress.com)
+- Kenneth Kalmer - http://opensourcery.co.za
+- Torsten Schönebaum - http://www.torstenschoenebaum.de
+- John Mettraux - http://jmettraux.wordpress.com
== Contributors
-- Joeri Samson (http://github.com/joerixaop)
+- Chris Buben - https://github.com/cbuben
+- Joeri Samson - https://github.com/joerixaop
View
@@ -32,8 +32,8 @@ gem 'rufus-json', '>= 0.2.5'
# ruote
-gem 'ruote', '~> 2.1.11'
-#gem 'ruote', :git => 'git://github.com/jmettraux/ruote.git', :branch => 'ruote2.1'
+#gem 'ruote', '~> 2.1.11'
+gem 'ruote', :git => 'git://github.com/jmettraux/ruote.git', :branch => 'ruote2.1'
#gem 'ruote', :path => '~/w/ruote/'
# Testing environment requirements
View
@@ -15,3 +15,6 @@
[ ] application/vnd.ruote.lambda.io+json;type=xxx
+[ ] update rspec
+[ ] write ruote-kit.gemspec manually
+
@@ -51,6 +51,7 @@
RuoteKit.engine.wait_for(@wfid)
@error = RuoteKit.engine.process(@wfid).errors.first
+ @fei = @error.fei
end
describe 'GET /_ruote/errors' do
@@ -109,7 +110,7 @@
# the links for the error itself
json['errors'].first['links'].should == [
- { 'href' => "/_ruote/errors/0_0_0!!#{@wfid}",
+ { 'href' => "/_ruote/errors/#{@fei.expid}!#{@fei.subid}!#{@wfid}",
'rel' => 'self' },
{ 'href' => "/_ruote/errors/#{@wfid}",
'rel' => 'http://ruote.rubyforge.org/rels.html#process_errors' },
@@ -143,7 +144,7 @@
json['errors'].first['message'].should == "#<RuntimeError: unknown participant or subprocess 'nemo'>"
json['errors'].first['links'].should == [
- { 'href' => "/_ruote/errors/0_0_0!!#{@wfid}",
+ { 'href' => "/_ruote/errors/#{@fei.expid}!#{@fei.subid}!#{@wfid}",
'rel' => 'self' },
{ 'href' => "/_ruote/errors/#{@wfid}",
'rel' => 'http://ruote.rubyforge.org/rels.html#process_errors' },
@@ -75,19 +75,19 @@ class fei links name parent
@wfid = launch_test_process
process = engine.process(@wfid)
- @nada_exp_id = process.expressions.last.fei.expid
+ @nada_fei = process.expressions.last.fei
end
it 'should render the expression (HTML)' do
- get "/_ruote/expressions/#{@nada_exp_id}!!#{@wfid}"
+ get "/_ruote/expressions/#{@nada_fei.expid}!#{@nada_fei.subid}!#{@wfid}"
last_response.should be_ok
end
it 'should render the expression (JSON)' do
- get "/_ruote/expressions/#{@nada_exp_id}!!#{@wfid}.json"
+ get "/_ruote/expressions/#{@nada_fei.expid}!#{@nada_fei.subid}!#{@wfid}.json"
last_response.should be_ok
@@ -103,15 +103,15 @@ class fei links name parent
it 'should include an etag header (HTML)' do
- get "/_ruote/expressions/#{@nada_exp_id}!!#{@wfid}"
+ get "/_ruote/expressions/#{@nada_fei.expid}!#{@nada_fei.subid}!#{@wfid}"
last_response.headers.should include('ETag')
last_response.headers['ETag'].should == "\"#{engine.process(@wfid).expressions.last.to_h['_rev'].to_s}\""
end
it 'should include an etag header (JSON)' do
- get "/_ruote/expressions/#{@nada_exp_id}!!#{@wfid}.json"
+ get "/_ruote/expressions/#{@nada_fei.expid}!#{@nada_fei.subid}!#{@wfid}.json"
last_response.headers.should include('ETag')
last_response.headers['ETag'].should == "\"#{engine.process(@wfid).expressions.last.to_h['_rev'].to_s}\""
@@ -146,11 +146,13 @@ class fei links name parent
end)
RuoteKit.engine.wait_for(:alpha)
+
+ @fei = RuoteKit.engine.process(@wfid).expressions.last.fei
end
it 'should render the expression (HTML)' do
- get "/_ruote/expressions/0_0!!#{@wfid}"
+ get "/_ruote/expressions/#{@fei.expid}!#{@fei.subid}!#{@wfid}"
last_response.status.should be(200)
@@ -160,7 +162,7 @@ class fei links name parent
it 'should render the expression (JSON)' do
- get "/_ruote/expressions/0_0!!#{@wfid}.json"
+ get "/_ruote/expressions/#{@fei.expid}!#{@fei.subid}!#{@wfid}.json"
last_response.status.should be(200)
@@ -195,13 +197,12 @@ class fei links name parent
end
end
- wait_exp = engine.process(@wfid).expressions.last
- @expid = "0_1_0" #wait_exp.fei.expid
+ @fei = engine.process(@wfid).expressions.last.fei
end
it 'should cancel the expressions (HTML)' do
- delete "/_ruote/expressions/#{@expid}!!#{@wfid}"
+ delete "/_ruote/expressions/#{@fei.expid}!#{@fei.subid}!#{@wfid}"
last_response.should be_redirect
last_response['Location'].should == "/_ruote/expressions/#{@wfid}"
@@ -214,7 +215,7 @@ class fei links name parent
it 'should cancel the expressions (JSON)' do
- delete "/_ruote/expressions/#{@expid}!!#{@wfid}.json"
+ delete "/_ruote/expressions/#{@fei.expid}!#{@fei.subid}!#{@wfid}.json"
last_response.should be_ok
last_response.json_body['status'].should == 'ok'
@@ -227,7 +228,7 @@ class fei links name parent
it 'should kill the expression (HTML)' do
- delete "/_ruote/expressions/#{@expid}!!#{@wfid}?_kill=1"
+ delete "/_ruote/expressions/#{@fei.expid}!#{@fei.subid}!#{@wfid}?_kill=1"
last_response.should be_redirect
last_response['Location'].should == "/_ruote/expressions/#{@wfid}"
@@ -240,7 +241,7 @@ class fei links name parent
it 'should kill the expression (JSON)' do
- delete "/_ruote/expressions/#{@expid}!!#{@wfid}.json?_kill=1"
+ delete "/_ruote/expressions/#{@fei.expid}!#{@fei.subid}!#{@wfid}.json?_kill=1"
last_response.should be_ok
last_response.json_body['status'].should == 'ok'
@@ -254,7 +255,7 @@ class fei links name parent
it 'should 412 when the etags do not match (HTML)' do
delete(
- "/_ruote/expressions/#{@expid}!!#{@wfid}",
+ "/_ruote/expressions/#{@fei.expid}!#{@fei.subid}!#{@wfid}",
nil,
{ 'HTTP_IF_MATCH' => '"foo"' }
)
@@ -265,7 +266,7 @@ class fei links name parent
it 'should 412 when the etags do not match (JSON)' do
delete(
- "/_ruote/expressions/#{@expid}!!#{@wfid}.json",
+ "/_ruote/expressions/#{@fei.expid}!#{@fei.subid}!#{@wfid}.json",
nil,
{
'HTTP_IF_MATCH' => '"foo"',
@@ -278,11 +279,11 @@ class fei links name parent
it 'should not 412 when the etags do match (HTML)' do
exp = RuoteKit.engine.process(@wfid).expressions.find { |e|
- e.fei.expid == @expid
+ e.fei.expid == @fei.expid
}
delete(
- "/_ruote/expressions/#{@expid}!!#{@wfid}",
+ "/_ruote/expressions/#{@fei.expid}!#{@fei.subid}!#{@wfid}",
nil,
{ 'HTTP_IF_MATCH' => ('"%s"' % exp.to_h['_rev'] ) }
)
@@ -292,11 +293,11 @@ class fei links name parent
it 'should not 412 when the etags do match (JSON)' do
exp = RuoteKit.engine.process(@wfid).expressions.find { |e|
- e.fei.expid == @expid
+ e.fei.expid == @fei.expid
}
delete(
- "/_ruote/expressions/#{@expid}!!#{@wfid}.json",
+ "/_ruote/expressions/#{@fei.expid}!#{@fei.subid}!#{@wfid}.json",
nil,
{
'HTTP_IF_MATCH' => ('"%s"' % exp.to_h['_rev'] ),
@@ -53,8 +53,8 @@
wfid = [ @wfid0, @wfid1 ].sort.first
- schedules.first['links'].first['href'].should ==
- "/_ruote/expressions/0_0!!#{wfid}"
+ schedules.first['links'].first['href'].should match(
+ /^\/_ruote\/expressions\/0_0![a-f0-9]+!#{wfid}$/)
end
end
Oops, something went wrong.

0 comments on commit 8a3565d

Please sign in to comment.