cascadence 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 484371533ba42c1dc48ec816d80c158c4a5fd67f
4
- data.tar.gz: 21c1e22cc2cb1212d76df06c68f3e9e906235727
3
+ metadata.gz: 097b2dcaacefb8ed9c0fefa622e501174aa357a6
4
+ data.tar.gz: d641fdc2c1e2ef83684352001a7c03605a32110f
5
5
  SHA512:
6
- metadata.gz: 903c91fcf31762e9115849b8db6fc816339d0e2d9be2437409c742acf8dec9ce106901c3549ca7248ef04c67c02849f6963943049e33109d9a1ee50e0e2b6976
7
- data.tar.gz: e934b7d1ef66b98e4156f01535c69a8d9f08a9e22d38502d89290ae6fd851e38b1019b3a94c5dc116d50144a9e2cd3351e0ee7c57022ca298f9a55f541287d8d
6
+ metadata.gz: f63f292372764f6854342b1d435749a4e690be338c4b47776cf5e6341c0ce54ed12a1c2804fa85fd2f8cfacec3327a9430be45b7a361676ab3a4fd81dfdd60f3
7
+ data.tar.gz: 64f3ba4d94614a78ea33f0a61cbcc9e0b839205860bfe73cc57585cf50381223d68f7a806cc2eca33efd7e3b440c3743a81fb7d61ed0c4f24beb039395d8fa87
data/README.markdown CHANGED
@@ -1,13 +1,113 @@
1
- = cascadence
1
+ cascadence
2
+ =
2
3
 
3
4
  Helper for organizing flow-based specs for such things as writing integration tests with rspec-capybara
4
5
 
6
+ Example Usage
7
+ =
8
+ Suppose you have the files:
9
+
10
+ ```
11
+ flows
12
+ |- spam
13
+ | |- spam_flow.rb
14
+ | |- hard_spam_flow.rb
15
+ |- spam.rb
16
+ |- flow_helper.rb
17
+ ```
18
+
19
+ 1. spam_flow.rb
20
+
21
+ ```ruby
22
+ module Spam
23
+ class SpamFlow < Cascadence::Flow
24
+
25
+ cascading_order :step1, :step2, :step3
26
+
27
+ def initialize(zero_state)
28
+ self.state = zero_state
29
+ end
30
+
31
+ def step1
32
+ self.state += 1
33
+ end
34
+
35
+ def step2
36
+ _modifiy_state_in_some_way
37
+ end
38
+
39
+ def step3
40
+ # more state modification
41
+ end
42
+
43
+ private
44
+
45
+ def _modify_state_in_some_way
46
+ # do stuff with self.state
47
+ end
48
+ end
49
+ end
50
+ ```
51
+
52
+ 1.5. hard_spam_flow.rb
53
+
54
+ ```ruby
55
+ module Spam
56
+ class HardSpamFlow < SpamFlow
57
+ fork_after :step1
58
+ merge_before :step2
59
+ cascading_order :step1point25, :step1point5
60
+
61
+ def step1point25
62
+ # modify state
63
+ end
64
+
65
+ def step1point5
66
+ # modify state
67
+ end
68
+ end
69
+ end
70
+ ```
71
+
72
+ 2. flow_helper.rb
73
+
74
+ ```ruby
75
+ require 'cascadence'
76
+ require 'spam'
77
+ require 'capybara'
78
+
79
+ Cascadence.config do |config|
80
+ config.parallel = true # or false
81
+ config.max_thread_count = 4
82
+ config.zero_state_generator = lambda { Capybara::Session.new :selenium }
83
+ end
84
+ ```
85
+
86
+ 3. spam.rb
87
+
88
+ ```ruby
89
+ require 'spam/spam_flow.rb'
90
+ require 'spam/hard_spam_flow.rb'
91
+ ```
92
+
93
+ How to run
94
+ =
95
+
96
+ ```sh
97
+ $ cascadence flows/ # runs all flows
98
+ $ cascadence flows/spam # runs all flows in the spam folder
99
+ $ cascadence flows/spam/spam_flow.rb # runs the spam_flow.rb flow
100
+ ```
101
+
5
102
  Notes
6
103
  =
7
104
  You (I guess that would be me) need to fix how cascadence order is read, right now, the dependence on
8
105
  recursion is extremely resource heavy and definitely a bad idea (if not a target for memory leaks)
9
- == Contributing to cascadence
10
-
106
+
107
+ Update: version 0.2.1 out and still not fixed. You (that would be me) are a major faggot.
108
+
109
+ Contributing to cascadence
110
+ ==
11
111
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
12
112
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
13
113
  * Fork the project.
@@ -16,8 +116,8 @@ recursion is extremely resource heavy and definitely a bad idea (if not a target
16
116
  * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
17
117
  * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
18
118
 
19
- == Copyright
20
-
119
+ Copyright
120
+ ==
21
121
  Copyright (c) 2013 Thomas Chen. See LICENSE.txt for
22
122
  further details.
23
123
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/cascadence.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "cascadence"
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Thomas Chen"]
@@ -60,7 +60,7 @@ module Cascadence
60
60
 
61
61
  def _get_zero_state_generator_from_flow(flow)
62
62
  return flow.zero_state_generator if flow.respond_to? :zero_state_generator
63
- return Cascadence.config.zero_state_generator if flow == Object
63
+ return Cascadence.config.zero_state_generator if flow == Object || !flow.respond_to?(:parent)
64
64
  _get_zero_state_generator_from_flow(flow.parent)
65
65
  end
66
66
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cascadence
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Chen