cukesalad 0.6.0 → 0.6.1

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.
Files changed (54) hide show
  1. data/.gitignore +15 -0
  2. data/Examples/Calculator/Gemfile +4 -5
  3. data/Examples/Calculator/Gemfile.lock +30 -33
  4. data/Examples/Calculator/features/lib/default/tasks/{add.rb → arithmetic/add.rb} +0 -0
  5. data/Examples/Calculator/features/lib/default/tasks/{calculate.rb → arithmetic/calculate.rb} +0 -0
  6. data/Examples/Calculator/features/lib/default/tasks/{subtract.rb → arithmetic/subtract.rb} +0 -0
  7. data/Examples/Calculator/features/lib/default/tasks/{see_the_answer.rb → questions/see_the_answer.rb} +0 -0
  8. data/Examples/Calculator/features/lib/default/tasks/{calculations.rb → reference/calculations.rb} +0 -0
  9. data/Gemfile +2 -7
  10. data/Gemfile.lock +29 -29
  11. data/Rakefile +1 -21
  12. data/cukesalad.gemspec +29 -0
  13. data/features/define_a_task.feature +17 -17
  14. data/features/remember_information_between_steps.feature +5 -5
  15. data/features/support/env.rb +0 -2
  16. data/lib/cukesalad.rb +2 -36
  17. data/lib/cukesalad/actor.rb +49 -0
  18. data/lib/cukesalad/codify/const_name.rb +23 -0
  19. data/lib/cukesalad/cucumber.rb +35 -0
  20. data/lib/cukesalad/director.rb +30 -0
  21. data/lib/cukesalad/salad.rb +3 -0
  22. data/lib/cukesalad/specifics.rb +36 -0
  23. data/lib/cukesalad/task_author.rb +21 -0
  24. data/lib/cukesalad/version.rb +3 -0
  25. data/spec/cukesalad/actor_spec.rb +96 -0
  26. data/spec/cukesalad/codify/as_const_name_spec.rb +30 -0
  27. data/spec/cukesalad/director_spec.rb +36 -0
  28. data/spec/cukesalad/specifics_spec.rb +68 -0
  29. data/spec/cukesalad/task_author_spec.rb +52 -0
  30. data/spec/spec_helper.rb +1 -4
  31. metadata +62 -59
  32. data/examples/Calculator/features/lib/alternative/roles/calculating_web_user.rb +0 -55
  33. data/examples/Calculator/features/lib/default/roles/calculating_individual.rb +0 -32
  34. data/examples/Calculator/features/lib/default/tasks/add.rb +0 -6
  35. data/examples/Calculator/features/lib/default/tasks/calculate.rb +0 -4
  36. data/examples/Calculator/features/lib/default/tasks/calculations.rb +0 -15
  37. data/examples/Calculator/features/lib/default/tasks/see_the_answer.rb +0 -3
  38. data/examples/Calculator/features/lib/default/tasks/subtract.rb +0 -4
  39. data/examples/Calculator/features/lib/default/tasks/switch_on_the_calculator.rb +0 -9
  40. data/examples/Calculator/features/support/env.rb +0 -5
  41. data/examples/Calculator/lib/calculator.rb +0 -53
  42. data/examples/Calculator/lib/web_calculator.rb +0 -82
  43. data/examples/Calculator/spec/calculator_spec.rb +0 -73
  44. data/examples/Calculator/spec/web_calculator_spec.rb +0 -99
  45. data/lib/actor.rb +0 -47
  46. data/lib/codify/const_name.rb +0 -21
  47. data/lib/director.rb +0 -28
  48. data/lib/specifics.rb +0 -34
  49. data/lib/task_author.rb +0 -12
  50. data/spec/actor_spec.rb +0 -96
  51. data/spec/codify/as_const_name_spec.rb +0 -28
  52. data/spec/director_spec.rb +0 -34
  53. data/spec/specifics_spec.rb +0 -67
  54. data/spec/task_author_spec.rb +0 -50
@@ -1,34 +0,0 @@
1
- $:.unshift(File.dirname(__FILE__), ".")
2
- require 'spec_helper'
3
-
4
- class Something
5
- end
6
- class Another
7
- end
8
- class MoreThanOneWord
9
- end
10
-
11
- describe Director do
12
-
13
- before :each do
14
- @director = Director.new
15
- end
16
-
17
- it "gives you directives (i.e. a class) for Something" do
18
- the_thing_we_found = @director.how_do_i_perform "something"
19
- the_thing_we_found.should == Something
20
- end
21
-
22
- it "finds directives (i.e. a class) for something described with more than one word" do
23
- the_thing_we_found = @director.how_do_i_perform "more than one word"
24
- the_thing_we_found.should == MoreThanOneWord
25
- end
26
-
27
- it "apologises when it can't find the role" do
28
- lambda { @director.explain_the_role "non existent role" }.should raise_error RuntimeError
29
- end
30
-
31
- it "apologises when it can't find the task" do
32
- lambda { @director.how_do_i_perform "non existent task" }.should raise_error RuntimeError
33
- end
34
- end
@@ -1,67 +0,0 @@
1
- $:.unshift(File.dirname(__FILE__), ".")
2
- require 'spec_helper'
3
-
4
- class NeedingSpecifics
5
- include Specifics
6
- end
7
-
8
- describe Specifics do
9
-
10
- it "has an item of specific information" do
11
- something = NeedingSpecifics.new
12
- something.understand_the "specific 'information'"
13
- something.value_of(:specific).should == "information"
14
- end
15
-
16
- it "has items of specific information" do
17
- something = NeedingSpecifics.new
18
- something.understand_the "first 'item' second 'another'"
19
- something.value_of(:first).should == "item"
20
- something.value_of(:second).should == "another"
21
- end
22
-
23
- it "copes with names having more than one word" do
24
- something = NeedingSpecifics.new
25
- something.understand_the "first thing 'item' second thing 'another'"
26
- something.value_of(:first_thing).should == "item"
27
- something.value_of(:second_thing).should == "another"
28
- end
29
-
30
- it "should cope with values having more than one word" do
31
- something = NeedingSpecifics.new
32
- something.understand_the "first thing 'item' second thing 'another thing'"
33
- something.value_of(:first_thing).should == "item"
34
- something.value_of(:second_thing).should == "another thing"
35
- end
36
-
37
- context 'the last item' do
38
- it "can be empty" do
39
- something = NeedingSpecifics.new
40
- something.understand_the "containing"
41
- something.value_of(:containing).should be_nil
42
- end
43
-
44
- it "can be the only item and have a value assigned" do
45
- something = NeedingSpecifics.new
46
- something.understand_the "containing"
47
- something.set_last('some value')
48
- something.value_of(:containing).should == 'some value'
49
- end
50
-
51
- it "can be the only item and be empty" do
52
- something = NeedingSpecifics.new
53
- something.understand_the "called 'something' containing"
54
- something.value_of(:called).should == 'something'
55
- something.value_of(:containing).should be_nil
56
- end
57
-
58
- it "can have a value assigned" do
59
- something = NeedingSpecifics.new
60
- something.understand_the "called 'something' containing"
61
- something.value_of(:called).should == 'something'
62
- something.set_last('some value')
63
- something.value_of(:containing).should == 'some value'
64
- end
65
-
66
- end
67
- end
@@ -1,50 +0,0 @@
1
- $:.unshift(File.dirname(__FILE__), ".")
2
- require 'spec_helper'
3
- require 'task_author'
4
-
5
- class SomeActor
6
- def see_how_to_do something
7
- extend something
8
- end
9
- def do_your_thing
10
- perform_task
11
- end
12
- def value_of thing
13
- "this is the info"
14
- end
15
- end
16
-
17
- describe 'TaskAuthor' do
18
-
19
- it "creates a module by the same name" do
20
- in_order_to "SomeTask" do;end
21
-
22
- SomeActor.new.see_how_to_do SomeTask
23
- end
24
-
25
- it "creates a module by a similar name" do
26
- in_order_to "some different task" do;end
27
-
28
- SomeActor.new SomeDifferentTask
29
- end
30
-
31
- it "enables the actor to do something" do
32
- in_order_to "SomeOtherTask" do
33
- "done"
34
- end
35
-
36
- actor = SomeActor.new
37
- actor.see_how_to_do SomeOtherTask
38
- actor.do_your_thing.should == "done"
39
- end
40
-
41
- it "maps some attributes" do
42
- in_order_to "YetAnotherTask", with_info: :info do
43
- the :info
44
- end
45
-
46
- actor = SomeActor.new
47
- actor.see_how_to_do YetAnotherTask
48
- actor.do_your_thing.should == "this is the info"
49
- end
50
- end