manamana 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,122 @@
1
+ require_relative '../../../test_helper'
2
+ require 'manamana/tdsl/nodes'
3
+
4
+ module ManaMana
5
+
6
+ module TDSL
7
+
8
+ describe TestCaseNode do
9
+
10
+ it "should translate if it is empty" do
11
+ node = TestCaseNode.new 'A new user with attributes (.+), (.+) is valid'
12
+ req = "A new user with attributes Bob, 123qwe is valid"
13
+ spec = <<-EOF
14
+ describe 'A new user with attributes Bob, 123qwe is valid' do
15
+ before do
16
+ /^A new user with attributes (.+), (.+) is valid$/i =~ "A new user with attributes Bob, 123qwe is valid"
17
+ end
18
+
19
+ after do
20
+ end
21
+
22
+ it 'must pass' do
23
+ raise 'Undefined test case'
24
+ end
25
+ end
26
+ EOF
27
+ node.translate(req).must_equal spec
28
+ end
29
+
30
+ it "should translate preconditions" do
31
+ node = TestCaseNode.new("A new user with attributes (.+), (.+) is valid", {
32
+ :variables => VariablesNode.new('', [
33
+ AssignmentNode.new('My Username = my_username'),
34
+ AssignmentNode.new('My Password = my_password')
35
+ ]),
36
+ :preconditions => PreconditionsNode.new('', [
37
+ StepNode.new('Ensure user with attributes <My Username>, <My Password> exists')
38
+ ])
39
+ })
40
+ req = "A new user with attributes Bob, 123qwe is valid"
41
+ spec = <<-EOF
42
+ describe 'A new user with attributes Bob, 123qwe is valid' do
43
+ before do
44
+ /^A new user with attributes (.+), (.+) is valid$/i =~ "A new user with attributes Bob, 123qwe is valid"
45
+ Steps.call "Ensure user with attributes " + my_username + ", " + my_password + " exists"
46
+ end
47
+
48
+ after do
49
+ end
50
+
51
+ it 'must pass' do
52
+ raise 'Undefined test case'
53
+ end
54
+ end
55
+ EOF
56
+ node.translate(req).must_equal spec
57
+ end
58
+
59
+ it "should translate cleanup" do
60
+ node = TestCaseNode.new("A new user with attributes (.+), (.+) is valid", {
61
+ :variables => VariablesNode.new('', [
62
+ AssignmentNode.new('My Username = my_username'),
63
+ AssignmentNode.new('My Password = my_password')
64
+ ]),
65
+ :cleanup => CleanupNode.new('', [
66
+ StepNode.new('Ensure user with attributes <My Username>, <My Password> does not exist')
67
+ ])
68
+ })
69
+ req = "A new user with attributes Bob, 123qwe is valid"
70
+ spec = <<-EOF
71
+ describe 'A new user with attributes Bob, 123qwe is valid' do
72
+ before do
73
+ /^A new user with attributes (.+), (.+) is valid$/i =~ "A new user with attributes Bob, 123qwe is valid"
74
+ end
75
+
76
+ after do
77
+ Steps.call "Ensure user with attributes " + my_username + ", " + my_password + " does not exist"
78
+ end
79
+
80
+ it 'must pass' do
81
+ raise 'Undefined test case'
82
+ end
83
+ end
84
+ EOF
85
+ node.translate(req).must_equal spec
86
+ end
87
+
88
+ it "should translate the script" do
89
+ node = TestCaseNode.new("A new user with attributes (.+), (.+) is valid", {
90
+ :variables => VariablesNode.new('', [
91
+ AssignmentNode.new('My Username = my_username'),
92
+ AssignmentNode.new('My Password = my_password')
93
+ ]),
94
+ :script => ScriptNode.new('', [
95
+ StepNode.new('Fill in the username field with <My Username>'),
96
+ StepNode.new('Fill in the password field with <My Password>')
97
+ ])
98
+ })
99
+ req = "A new user with attributes Bob, 123qwe is valid"
100
+ spec = <<-EOF
101
+ describe 'A new user with attributes Bob, 123qwe is valid' do
102
+ before do
103
+ /^A new user with attributes (.+), (.+) is valid$/i =~ "A new user with attributes Bob, 123qwe is valid"
104
+ end
105
+
106
+ after do
107
+ end
108
+
109
+ it 'must pass' do
110
+ Steps.call "Fill in the username field with " + my_username + ""
111
+ Steps.call "Fill in the password field with " + my_password + ""
112
+ end
113
+ end
114
+ EOF
115
+ node.translate(req).must_equal spec
116
+ end
117
+
118
+ end # describe TestCaseNode
119
+
120
+ end # module TDSL
121
+
122
+ end # module ManaMana
@@ -0,0 +1,9 @@
1
+ require_relative '../../test_helper'
2
+
3
+ describe "ManaMana VERSION" do
4
+
5
+ it "must be defined" do
6
+ ManaMana::VERSION.wont_be_nil
7
+ end
8
+
9
+ end
@@ -0,0 +1,21 @@
1
+ # Add the gem's lib folder to the load path
2
+ $:.unshift File.expand_path("../../lib", __FILE__)
3
+
4
+ require "bundler/setup"
5
+ require "minitest/autorun"
6
+ require "minitest/colorize"
7
+ require "manamana"
8
+
9
+ def get_or_create_tmp_dir
10
+ root_dir = get_root_dir
11
+ Dir.mkdir 'tmp' unless root_dir.entries.include? 'tmp'
12
+ Dir.chdir 'tmp'
13
+ Dir.new(Dir.pwd)
14
+ end
15
+
16
+ def get_root_dir
17
+ unless Dir.new(Dir.pwd).entries.include? 'manamana.gemspec'
18
+ Dir.chdir '..'
19
+ end
20
+ Dir.new(Dir.pwd)
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manamana
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,25 +9,66 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-08 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2013-03-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: racc
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - '='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.4.9
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - '='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.4.9
14
30
  description: Capture project requirements better
15
31
  email:
16
32
  - mmaglana@gmail.com
17
- executables: []
33
+ executables:
34
+ - mana
18
35
  extensions: []
19
36
  extra_rdoc_files: []
20
37
  files:
21
38
  - .gitignore
22
39
  - .rvmrc
23
40
  - Gemfile
41
+ - Gemfile.lock
42
+ - Guardfile
24
43
  - LICENSE
25
44
  - README.md
26
45
  - Rakefile
46
+ - bin/mana
27
47
  - lib/manamana.rb
48
+ - lib/manamana/compiler.rb
49
+ - lib/manamana/rdsl/lexer.rb
50
+ - lib/manamana/rdsl/nodes.rb
51
+ - lib/manamana/rdsl/parser.rb
52
+ - lib/manamana/runner.rb
53
+ - lib/manamana/steps.rb
54
+ - lib/manamana/tdsl/lexer.rb
55
+ - lib/manamana/tdsl/nodes.rb
56
+ - lib/manamana/tdsl/parser.rb
28
57
  - lib/manamana/version.rb
29
58
  - manamana.gemspec
30
- homepage: https://github.com/relaxdiego/manamana
59
+ - src/rdsl/lexer.rl
60
+ - src/rdsl/parser.y
61
+ - src/tdsl/lexer.rl
62
+ - src/tdsl/parser.y
63
+ - test/lib/manamana/rdsl/lexer_test.rb
64
+ - test/lib/manamana/rdsl/parser_test.rb
65
+ - test/lib/manamana/rdsl/requirements_node_test.rb
66
+ - test/lib/manamana/tdsl/lexer_test.rb
67
+ - test/lib/manamana/tdsl/parser_test.rb
68
+ - test/lib/manamana/tdsl/test_case_node_test.rb
69
+ - test/lib/manamana/version_test.rb
70
+ - test/test_helper.rb
71
+ homepage: https://github.com/ManaManaFramework/manamana
31
72
  licenses: []
32
73
  post_install_message:
33
74
  rdoc_options: []
@@ -39,12 +80,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
39
80
  - - ! '>='
40
81
  - !ruby/object:Gem::Version
41
82
  version: '0'
83
+ segments:
84
+ - 0
85
+ hash: 882666223729578464
42
86
  required_rubygems_version: !ruby/object:Gem::Requirement
43
87
  none: false
44
88
  requirements:
45
89
  - - ! '>='
46
90
  - !ruby/object:Gem::Version
47
91
  version: '0'
92
+ segments:
93
+ - 0
94
+ hash: 882666223729578464
48
95
  requirements: []
49
96
  rubyforge_project:
50
97
  rubygems_version: 1.8.25
@@ -53,4 +100,12 @@ specification_version: 3
53
100
  summary: Organize your project's requirements and their associated test cases in a
54
101
  way that makes sense to your organization. Then keep track of the status of each
55
102
  as your project progresses.
56
- test_files: []
103
+ test_files:
104
+ - test/lib/manamana/rdsl/lexer_test.rb
105
+ - test/lib/manamana/rdsl/parser_test.rb
106
+ - test/lib/manamana/rdsl/requirements_node_test.rb
107
+ - test/lib/manamana/tdsl/lexer_test.rb
108
+ - test/lib/manamana/tdsl/parser_test.rb
109
+ - test/lib/manamana/tdsl/test_case_node_test.rb
110
+ - test/lib/manamana/version_test.rb
111
+ - test/test_helper.rb