dtf 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,18 +14,21 @@ describe "User" do
14
14
 
15
15
  it "should be invalid without a user_name" do
16
16
  user.should_not be_valid
17
+ user.errors.should_not be_empty
17
18
  user.errors.messages[:user_name].should eq(["can't be blank"])
18
19
  user.new_record?.should be_true
19
20
  end
20
21
 
21
22
  it "should be invalid without an email_address" do
22
23
  user.should_not be_valid
24
+ user.errors.should_not be_empty
23
25
  user.errors.messages[:email_address].should eq(["can't be blank"])
24
26
  user.new_record?.should be_true
25
27
  end
26
28
 
27
29
  it "should be invalid without a full_name" do
28
30
  user.should_not be_valid
31
+ user.errors.should_not be_empty
29
32
  user.errors.messages[:full_name].should eq(["can't be blank"])
30
33
  user.new_record?.should be_true
31
34
  end
@@ -42,7 +45,7 @@ describe "User" do
42
45
 
43
46
  it "should have a valid user_name, full_name, and email_address" do
44
47
  user.should be_valid
45
- user.errors.messages.should be_empty
48
+ user.errors.should be_empty
46
49
  user.user_name.should_not be_nil
47
50
  user.full_name.should_not be_nil
48
51
  user.email_address.should_not be_nil
@@ -14,18 +14,21 @@ describe "VerificationSuite" do
14
14
 
15
15
  it "should be invalid without being assigned to a user" do
16
16
  verification_suite.should_not be_valid
17
+ verification_suite.errors.should_not be_empty
17
18
  verification_suite[:user_id].should be_nil
18
19
  verification_suite.new_record?.should be_true
19
20
  end
20
21
 
21
22
  it "should be invalid without a name" do
22
23
  verification_suite.should_not be_valid
24
+ verification_suite.errors.should_not be_empty
23
25
  verification_suite.errors.messages[:name].should eq(["can't be blank"])
24
26
  verification_suite.new_record?.should be_true
25
27
  end
26
28
 
27
29
  it "should be invalid without a description" do
28
30
  verification_suite.should_not be_valid
31
+ verification_suite.errors.should_not be_empty
29
32
  verification_suite.errors.messages[:description].should eq(["can't be blank"])
30
33
  verification_suite.new_record?.should be_true
31
34
  end
@@ -47,7 +50,7 @@ describe "VerificationSuite" do
47
50
 
48
51
  it "should have a valid name and description" do
49
52
  verification_suite.should be_valid
50
- verification_suite.errors.messages.should be_empty
53
+ verification_suite.errors.should be_empty
51
54
  verification_suite.name.should_not be_nil
52
55
  verification_suite.description.should_not be_nil
53
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dtf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-16 00:00:00.000000000 Z
12
+ date: 2012-09-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -268,7 +268,7 @@ dependencies:
268
268
  - !ruby/object:Gem::Version
269
269
  version: '0'
270
270
  description: DTF is a modular testing framework skeleton. This is the control gem
271
- which contains the Suite's db schema(s) and control/management scripts.
271
+ containing the db schema(s) and command-line script.
272
272
  email:
273
273
  - me@daviddwdowney.com
274
274
  executables:
@@ -277,7 +277,6 @@ extensions: []
277
277
  extra_rdoc_files: []
278
278
  files:
279
279
  - .gitignore
280
- - .idea/bashsupport_project.xml
281
280
  - .rspec
282
281
  - .rvmrc
283
282
  - .travis.yml
@@ -298,12 +297,12 @@ files:
298
297
  - db/migrate/20120616203436_create_case_tests.rb
299
298
  - db/schema.rb
300
299
  - db/seeds.rb
301
- - doc/.gitkeep
302
300
  - doc/AnalysisCase.html
303
301
  - doc/CaseTest.html
304
302
  - doc/Dtf.html
305
303
  - doc/Dtf/Command.html
306
- - doc/Dtf/HelpSystem.html
304
+ - doc/Dtf/ErrorSystem.html
305
+ - doc/Dtf/OptionsParser.html
307
306
  - doc/User.html
308
307
  - doc/VerificationSuite.html
309
308
  - doc/_index.html
@@ -324,8 +323,6 @@ files:
324
323
  - examples/db/config.yml
325
324
  - lib/config/environment.rb
326
325
  - lib/dtf.rb
327
- - lib/dtf/error_system.rb
328
- - lib/dtf/help_system.rb
329
326
  - lib/dtf/version.rb
330
327
  - lib/tasks/setup.thor
331
328
  - spec/acceptance/create_basic_associations.feature
@@ -366,7 +363,7 @@ rubyforge_project: dtf
366
363
  rubygems_version: 1.8.24
367
364
  signing_key:
368
365
  specification_version: 3
369
- summary: DTF is a modular testing framework. This is the control gem.
366
+ summary: DTF is a modular testing framework. This is the master gem for the DTF framework.
370
367
  test_files:
371
368
  - spec/acceptance/create_basic_associations.feature
372
369
  - spec/acceptance/implement_help_system.feature
data/doc/.gitkeep DELETED
File without changes
@@ -1,128 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>
7
- Module: Dtf::HelpSystem
8
-
9
- &mdash; Documentation by YARD 0.8.2.1
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
19
- relpath = '../';
20
- framesUrl = "../frames.html#!" + escape(window.location.href);
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="../_index.html">Index (H)</a> &raquo;
35
- <span class='title'><span class='object_link'><a href="../Dtf.html" title="Dtf (module)">Dtf</a></span></span>
36
- &raquo;
37
- <span class="title">HelpSystem</span>
38
-
39
-
40
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
- </div>
42
-
43
- <div id="search">
44
-
45
- <a class="full_list_link" id="class_list_link"
46
- href="../class_list.html">
47
- Class List
48
- </a>
49
-
50
- <a class="full_list_link" id="method_list_link"
51
- href="../method_list.html">
52
- Method List
53
- </a>
54
-
55
- <a class="full_list_link" id="file_list_link"
56
- href="../file_list.html">
57
- File List
58
- </a>
59
-
60
- </div>
61
- <div class="clear"></div>
62
- </div>
63
-
64
- <iframe id="search_frame"></iframe>
65
-
66
- <div id="content"><h1>Module: Dtf::HelpSystem
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
- <dt class="r1 last">Defined in:</dt>
82
- <dd class="r1 last">lib/dtf/help_system.rb</dd>
83
-
84
- </dl>
85
- <div class="clear"></div>
86
-
87
-
88
- <h2>Constant Summary</h2>
89
-
90
- <dl class="constants">
91
-
92
- <dt id="SUB_COMMANDS-constant" class="">SUB_COMMANDS =
93
- <div class="docstring">
94
- <div class="discussion">
95
-
96
- <p>List of all sub-commands known within the Help System</p>
97
-
98
-
99
- </div>
100
- </div>
101
- <div class="tags">
102
-
103
-
104
- </div>
105
- </dt>
106
- <dd><pre class="code"><span class='qwords_beg'>%w(</span><span class='tstring_content'>create_user</span><span class='words_sep'> </span><span class='tstring_content'>delete_user</span><span class='words_sep'> </span><span class='tstring_content'>create_vs</span><span class='words_sep'> </span><span class='tstring_content'>delete_vs</span><span class='words_sep'>)</span></pre></dd>
107
-
108
- </dl>
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
- </div>
120
-
121
- <div id="footer">
122
- Generated on Sun Sep 16 12:04:53 2012 by
123
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
124
- 0.8.2.1 (ruby-1.9.3).
125
- </div>
126
-
127
- </body>
128
- </html>
@@ -1,16 +0,0 @@
1
- # encoding: UTF-8
2
- # Reusable error response method
3
- def raise_error(cmd)
4
- raise ArgumentError
5
- rescue
6
- $stderr.puts "ERROR! #{cmd} did not receive all required options."
7
- $stderr.puts "See 'dtf #{cmd} -h' for help with this sub-command"
8
-
9
- # Set non-zero exit value on error, for scripting use.
10
- abort()
11
- end
12
-
13
- def display_errors(cmd)
14
- # TODO: Refactor error display to take sub-command as an arg
15
- # and display obj.errors.messages.each properly for each arg type.
16
- end
@@ -1,59 +0,0 @@
1
- # encoding: UTF-8
2
- # DTF Help System
3
- require 'trollop' # Used to implement help system
4
-
5
- module Dtf::HelpSystem
6
-
7
- # List of all sub-commands known within the Help System
8
- SUB_COMMANDS = %w(create_user delete_user create_vs delete_vs)
9
-
10
- # Global options default to '--version|-v' and '--help|-h'
11
- global_opts = Trollop::options do
12
- version "DTF v#{Dtf::VERSION}"
13
- banner <<-EOS
14
- #{version}
15
- (c) Copyright 2012 David Deryl Downey / Deryl R. Doucette. All Rights Reserved.
16
- This is free software; see the LICENSE file for copying conditions.
17
- There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18
-
19
- Usage:
20
- dtf -v|--version -h|--help [[sub_cmds <options>] -h|--help]
21
-
22
- Valid [sub_cmds] are: create_(user|vs), delete_(user|vs)
23
- See 'dtf [sub_cmd] -h' for each sub_cmd's details and options
24
-
25
- EOS
26
- stop_on SUB_COMMANDS
27
- end
28
-
29
- @cmd = ARGV.shift
30
- @cmd_opts = case @cmd
31
- when "create_user"
32
- Trollop::options do
33
- opt(:user_name, desc="Username for new TF user - REQUIRED", opts={:type => :string, :short => '-u'})
34
- opt(:full_name, desc="Real name for new TF user - REQUIRED", opts={:type => :string, :short => '-n'})
35
- opt(:email_address, desc="Email address for new TF user - REQUIRED", opts={:type => :string, :short => '-e'})
36
- end
37
- when "create_vs"
38
- Trollop::options do
39
- opt(:user_name, desc="TF user to associate this VS with - REQUIRED", opts={:type => :string, :short => '-u'})
40
- opt(:name, desc="Name for new VS - REQUIRED", opts={:type => :string, :short => '-n'})
41
- opt(:description, desc="Description of VS's intended use - OPTIONAL", opts={:type => :string, :short => '-d', :default => ''})
42
- end
43
- when "delete_user"
44
- Trollop::options do
45
- opt(:user_name, desc="Username of TF user to delete - REQUIRED", opts={:type => :string, :short => '-u'})
46
- opt(:delete_all, desc="Delete _all_ VSs this user owns", :type => :flag, :default => true)
47
- end
48
- when "delete_vs"
49
- Trollop::options do
50
- opt(:user_name, desc="Username of VS owner - REQUIRED", opts={:type => :string, :short => '-u'})
51
- opt(:id, desc="ID of VS to be deleted - REQUIRED", opts={:type => :int, :short => '-i'})
52
- end
53
- when nil
54
- Trollop::die "No command specified! Please specify an applicable command"
55
- else
56
- Trollop::die "Unknown DTF sub-command: #{@cmd.inspect}"
57
- end
58
-
59
- end