dtf-session 0.0.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.
data/Gemfile ADDED
@@ -0,0 +1,29 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in dtf-session.gemspec
4
+ group :development, :test do
5
+ gem 'debugger'
6
+ gem 'pry'
7
+ gem 'pry-doc'
8
+ gem 'pry-debugger'
9
+ gem "pry-git"
10
+ gem "pry-developer_tools"
11
+ gem "pry-syntax-hacks"
12
+ gem "pry-editline"
13
+ gem "pry-highlight"
14
+ gem "pry-buffers"
15
+ gem "pry-stack_explorer"
16
+ gem "pry-exception_explorer"
17
+ gem "jist"
18
+ gem "pry-theme"
19
+ gem 'simplecov'
20
+ gem 'database_cleaner'
21
+ gem 'travis-lint'
22
+ gem 'rspec-formatter-webkit'
23
+ end
24
+
25
+ group :test do
26
+ gem 'cover_me'
27
+ end
28
+
29
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,201 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ dtf-session (0.0.1)
5
+ dtf
6
+ json
7
+ json_pure
8
+ rake
9
+ session
10
+ sqlite3
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ actionpack (3.2.8)
16
+ activemodel (= 3.2.8)
17
+ activesupport (= 3.2.8)
18
+ builder (~> 3.0.0)
19
+ erubis (~> 2.7.0)
20
+ journey (~> 1.0.4)
21
+ rack (~> 1.4.0)
22
+ rack-cache (~> 1.2)
23
+ rack-test (~> 0.6.1)
24
+ sprockets (~> 2.1.3)
25
+ activemodel (3.2.8)
26
+ activesupport (= 3.2.8)
27
+ builder (~> 3.0.0)
28
+ activerecord (3.2.8)
29
+ activemodel (= 3.2.8)
30
+ activesupport (= 3.2.8)
31
+ arel (~> 3.0.2)
32
+ tzinfo (~> 0.3.29)
33
+ activesupport (3.2.8)
34
+ i18n (~> 0.6)
35
+ multi_json (~> 1.0)
36
+ arel (3.0.2)
37
+ binding_of_caller (0.6.8)
38
+ builder (3.0.3)
39
+ coderay (1.0.8)
40
+ columnize (0.3.6)
41
+ configatron (2.9.1)
42
+ yamler (>= 0.1.0)
43
+ cover_me (1.2.0)
44
+ configatron
45
+ hashie
46
+ database_cleaner (0.8.0)
47
+ debugger (1.1.4)
48
+ columnize (>= 0.3.1)
49
+ debugger-linecache (~> 1.1.1)
50
+ debugger-ruby_core_source (~> 1.1.3)
51
+ debugger-linecache (1.1.2)
52
+ debugger-ruby_core_source (>= 1.1.1)
53
+ debugger-ruby_core_source (1.1.3)
54
+ diff-lcs (1.1.3)
55
+ diffy (2.0.8)
56
+ dtf (0.3.9)
57
+ activemodel
58
+ activerecord
59
+ activesupport
60
+ json
61
+ json_pure
62
+ rake
63
+ sqlite3
64
+ standalone_migrations
65
+ thor
66
+ trollop
67
+ erubis (2.7.0)
68
+ fabrication (2.3.0)
69
+ fattr (2.2.1)
70
+ grit (2.5.0)
71
+ diff-lcs (~> 1.1)
72
+ mime-types (~> 1.15)
73
+ posix-spawn (~> 0.3.6)
74
+ hashie (1.2.0)
75
+ hashr (0.0.22)
76
+ hike (1.2.1)
77
+ i18n (0.6.1)
78
+ jist (1.0.1)
79
+ json
80
+ journey (1.0.4)
81
+ json (1.7.5)
82
+ json_pure (1.7.5)
83
+ method_source (0.8)
84
+ mime-types (1.19)
85
+ multi_json (1.3.6)
86
+ nokogiri (1.5.5)
87
+ posix-spawn (0.3.6)
88
+ pry (0.9.10)
89
+ coderay (~> 1.0.5)
90
+ method_source (~> 0.8)
91
+ slop (~> 3.3.1)
92
+ pry-buffers (1.0.0)
93
+ pry
94
+ pry-doc
95
+ pry-debugger (0.2.0)
96
+ debugger (~> 1.1.3)
97
+ pry (~> 0.9.9)
98
+ pry-developer_tools (0.1.1)
99
+ pry (>= 0.9.8.pre, < 0.11)
100
+ pry-doc (0.4.4)
101
+ pry (>= 0.9.9.6)
102
+ yard (~> 0.8.1)
103
+ pry-editline (1.1.1)
104
+ pry-exception_explorer (0.2.3)
105
+ pry-stack_explorer (>= 0.4.6)
106
+ pry-git (0.2.3)
107
+ diffy
108
+ grit
109
+ pry (>= 0.9.8)
110
+ pry-highlight (0.0.1)
111
+ coderay
112
+ json
113
+ nokogiri
114
+ pry
115
+ pry-stack_explorer (0.4.7)
116
+ binding_of_caller (~> 0.6.8)
117
+ pry-syntax-hacks (0.0.6)
118
+ pry (>= 0.9.8)
119
+ pry-theme (0.1.3)
120
+ json
121
+ rack (1.4.1)
122
+ rack-cache (1.2)
123
+ rack (>= 0.4)
124
+ rack-ssl (1.3.2)
125
+ rack
126
+ rack-test (0.6.2)
127
+ rack (>= 1.0)
128
+ railties (3.2.8)
129
+ actionpack (= 3.2.8)
130
+ activesupport (= 3.2.8)
131
+ rack-ssl (~> 1.3.2)
132
+ rake (>= 0.8.7)
133
+ rdoc (~> 3.4)
134
+ thor (>= 0.14.6, < 2.0)
135
+ rake (0.9.2.2)
136
+ rdoc (3.12)
137
+ json (~> 1.4)
138
+ redcarpet (2.1.1)
139
+ rspec (2.11.0)
140
+ rspec-core (~> 2.11.0)
141
+ rspec-expectations (~> 2.11.0)
142
+ rspec-mocks (~> 2.11.0)
143
+ rspec-core (2.11.1)
144
+ rspec-expectations (2.11.3)
145
+ diff-lcs (~> 1.1.3)
146
+ rspec-formatter-webkit (2.2.0)
147
+ rspec-core (~> 2.7)
148
+ rspec-mocks (2.11.3)
149
+ session (3.1.0)
150
+ fattr
151
+ simplecov (0.7.0)
152
+ multi_json (~> 1.0)
153
+ simplecov-html (~> 0.7.0)
154
+ simplecov-html (0.7.0)
155
+ slop (3.3.3)
156
+ sprockets (2.1.3)
157
+ hike (~> 1.2)
158
+ rack (~> 1.0)
159
+ tilt (~> 1.1, != 1.3.0)
160
+ sqlite3 (1.3.6)
161
+ standalone_migrations (2.0.1)
162
+ activerecord (~> 3.2.6)
163
+ railties (~> 3.2.6)
164
+ rake
165
+ thor (0.16.0)
166
+ tilt (1.3.3)
167
+ travis-lint (1.4.0)
168
+ hashr (>= 0.0.19)
169
+ trollop (2.0)
170
+ tzinfo (0.3.33)
171
+ yamler (0.1.0)
172
+ yard (0.8.2.1)
173
+
174
+ PLATFORMS
175
+ ruby
176
+
177
+ DEPENDENCIES
178
+ cover_me
179
+ database_cleaner
180
+ debugger
181
+ dtf-session!
182
+ fabrication
183
+ jist
184
+ pry
185
+ pry-buffers
186
+ pry-debugger
187
+ pry-developer_tools
188
+ pry-doc
189
+ pry-editline
190
+ pry-exception_explorer
191
+ pry-git
192
+ pry-highlight
193
+ pry-stack_explorer
194
+ pry-syntax-hacks
195
+ pry-theme
196
+ redcarpet
197
+ rspec
198
+ rspec-formatter-webkit
199
+ simplecov
200
+ travis-lint
201
+ yard
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Deryl R. Doucette
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,107 @@
1
+ # Deryls Testing Framework
2
+
3
+ DTF is designed to be a modular framework for testing everything from shell scripts, to Ruby, to Rails apps.
4
+
5
+ DTF is an umbrella which is designed to incorporate multiple sub-gems, each of which provides additional
6
+ functionality to DTF. DTF is the master skeleton within which all other dtf-* gems integrate.
7
+
8
+ ## Internal architecture
9
+
10
+ DTF is designed in such a way that, with the master skeleton in place, one has only to load additional plugins
11
+ from any available DTF extension gem to add additional functionality. This can be anything ranging from
12
+ additional languages such as Ruby, Python, C, C++, etc, to testing methods and methodologies.
13
+
14
+ ## DTF-Session Gem
15
+
16
+ 'dtf-session' gem is part of the DTF <dtf-gems.deryldoucette.com> framework, and is designed for
17
+ Bash shell command-line based testing.
18
+
19
+ ## Installation
20
+ There are several ways to install, and configure the 'dtf-session' gem.
21
+
22
+ 1) You would run ```gem install dtf-session```, and once installed, run ```rake dtf:install``` to
23
+ install the DTF baseline thor task(s).
24
+
25
+ 2) You would include the gem in your project's Gemfile and ```bundle install```. Once installed,
26
+ you would then run ```rake dtf:install``` to install the DTF baseline thor task(s).
27
+
28
+ In both instances, you would continue on with the following instructions.
29
+
30
+ DTF uses Thor for setup and configuration, and has 3 possible sub-tasks under task name 'dtf_setup':
31
+
32
+ ```sh
33
+ ∴ thor list
34
+ dtf_setup
35
+ ---------
36
+ thor dtf_setup:config [NAME] # Copy db configuration file(s)
37
+ thor dtf_setup:install # Installs database migrations, the main schema, and configuration files
38
+ ```
39
+
40
+ As you can see, you can copy just the db config files, and/or the migrations, and main schema.
41
+
42
+ ```sh
43
+ ∴ thor help dtf_setup
44
+ Tasks:
45
+ thor dtf_setup:config [NAME] # Copy db configuration file(s)
46
+ thor dtf_setup:help [TASK] # Describe available tasks or one specific task
47
+ thor dtf_setup:install # Installs database migrations, the main schema, and configuration files
48
+ ```
49
+
50
+ To see how to install everything you would run the following command:
51
+
52
+ ```sh
53
+ ∴ thor dtf_setup:help install
54
+ Usage:
55
+ thor dtf_setup:install
56
+
57
+ Options:
58
+ [--force]
59
+
60
+ Installs database migrations, the main schema, and configuration files
61
+ ```
62
+
63
+ To see how to install just the configuration files for accessing the database(s), you would run:
64
+
65
+ ```sh
66
+ ∴ thor dtf_setup:help config
67
+ Usage:
68
+ thor dtf_setup:config [NAME]
69
+
70
+ Options:
71
+ [--force]
72
+
73
+ Copy db configuration file(s)
74
+ ```
75
+
76
+ Once the configuration files and/or database migrations are in place, the remaining setup is handled by 'rake'.
77
+ To see all possible commands, you would run 'rake -T', and pick the one(s) you need.
78
+
79
+ ```sh
80
+ ∴ rake -T
81
+ rake build # Build dtf-0.2.2.gem into the pkg directory
82
+ rake db:create # Create the database from config/database.yml for the current Rails.env (use db:create:all to create all dbs i...
83
+ rake db:drop # Drops the database for the current Rails.env (use db:drop:all to drop all databases)
84
+ rake db:fixtures:load # Load fixtures into the current environment's database.
85
+ rake db:migrate # Migrate the database (options: VERSION=x, VERBOSE=false).
86
+ rake db:migrate:status # Display status of migrations
87
+ rake db:new_migration # Create a new migration
88
+ rake db:rollback # Rolls the schema back to the previous version (specify steps w/ STEP=n).
89
+ rake db:schema:dump # Create a db/schema.rb file that can be portably used against any DB supported by AR
90
+ rake db:schema:load # Load a schema.rb file into the database
91
+ rake db:seed # Load the seed data from db/seeds.rb
92
+ rake db:setup # Create the database, load the schema, and initialize with the seed data (use db:reset to also drop the db first)
93
+ rake db:structure:dump # Dump the database structure to db/structure.sql. Specify another file with DB_STRUCTURE=db/my_structure.sql
94
+ rake db:version # Retrieves the current schema version number
95
+ rake install # Build and install dtf-0.2.2.gem into system gems
96
+ rake release # Create tag v0.2.2 and build and push dtf-0.2.2.gem to Rubygems
97
+ ```
98
+
99
+
100
+ ## Usage
101
+ Once you have finished configuring your database(s) and applying all migrations, you are now ready to work with
102
+ DTF directly. The following is a summary of all current possible commands, and their expected options/parameters:
103
+
104
+ ** STILL TO BE WRITTEN ***
105
+
106
+ --
107
+ Enjoy!
data/Rakefile ADDED
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env rake
2
+ # encoding: UTF-8
3
+
4
+ require "bundler/gem_tasks"
5
+
6
+ begin
7
+ require 'tasks/standalone_migrations'
8
+ rescue LoadError => e
9
+ puts "gem install standalone_migrations to get db:migrate:* tasks! (Error: #{e})"
10
+ end
11
+
12
+ namespace :cover_me do
13
+
14
+ desc "Generates and opens code coverage report."
15
+ task :report do
16
+ require 'cover_me'
17
+ CoverMe.complete!
18
+ end
19
+
20
+ end
21
+
22
+ task :test do
23
+ Rake::Task['cover_me:report'].invoke
24
+ end
25
+
26
+ task :spec do
27
+ Rake::Task['cover_me:report'].invoke
28
+ end
29
+
30
+ namespace :dtf do
31
+
32
+ desc "Install DTF thor tasks"
33
+ task :install do
34
+ require 'dtf'
35
+ puts "Installing DTF tasks"
36
+ FileUtils.cp(Dir.glob("#{File.join("#{Gem.loaded_specs['dtf'].gem_dir}", 'lib/tasks/*')}"), 'lib/tasks/')
37
+ end
38
+ end
39
+
@@ -0,0 +1,15 @@
1
+ # encoding: UTF-8
2
+
3
+ # AnalysisCase defines the 'test premise', which is broken down into steps called CaseTests
4
+ #
5
+ # AnalysisCases own CaseTests. Users own each CaseTest through its AnalysisCase
6
+ class AnalysisCase < ActiveRecord::Base
7
+
8
+ attr_accessible :name, :description
9
+ validates_presence_of :name, :description
10
+
11
+ belongs_to :verification_suite, :autosave => :true
12
+ belongs_to :user, :autosave => :true
13
+ has_many :case_tests, :dependent => :destroy
14
+
15
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: UTF-8
2
+
3
+ # CaseTest is the recording of each individual step of an AnalysisCase's 'test premise'
4
+ class CaseTest < ActiveRecord::Base
5
+
6
+ attr_accessible :description, :cmd
7
+ validates_presence_of :description, :cmd
8
+
9
+ belongs_to :analysis_case, :autosave => :true
10
+ has_one :verification_suite, :through => :analysis_case, :autosave => :true
11
+ end
@@ -0,0 +1,14 @@
1
+ # encoding: UTF-8
2
+
3
+ # User class owns all Verification Suites in the DTF system
4
+ class User < ActiveRecord::Base
5
+
6
+ attr_accessible :full_name, :email_address, :user_name
7
+ validates :full_name, :email_address, :user_name, :presence => true
8
+ validates :user_name, :email_address, :uniqueness => true
9
+
10
+ has_many :verification_suites, :dependent => :destroy
11
+ has_many :analysis_cases, :through => :verification_suites, :dependent => :destroy
12
+ has_many :case_tests, :through => :verification_suites, :dependent => :destroy
13
+
14
+ end
@@ -0,0 +1,23 @@
1
+ # encoding: UTF-8
2
+
3
+ # VerificationSuite is the core container class.
4
+ #
5
+ # ASSOCIATIONS BREAKDOWN: It contains many AnalysisCases. Each AnalysisCase contains
6
+ # multiple case_tests, owned by both the User and the AnalysisCase. The goal is to
7
+ # make 'packs' of tests which Users can share between Suites, grouped by Cases, and
8
+ # even share those Tests between Cases.
9
+ #
10
+ # Also, Users should be able to share their individual Test(s), AnalysisCase(s), through
11
+ # their VerificationSuite(s) with other Users for inclusion in their own AnalysisCase(s)
12
+ # and Suite(s) allowing for mix-and-match batching.
13
+
14
+ class VerificationSuite < ActiveRecord::Base
15
+
16
+ attr_accessible :name, :description
17
+ validates_presence_of :name, :description
18
+
19
+ belongs_to :user, :autosave => :true
20
+ has_many :analysis_cases, :dependent => :destroy
21
+ has_many :case_tests, :through => :analysis_cases, :dependent => :destroy
22
+
23
+ end
data/db/config.yml ADDED
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/dtf_session_development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/dtf_session_test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/dtf_session_production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
Binary file
Binary file
data/db/schema.rb ADDED
@@ -0,0 +1,48 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20120616203436) do
15
+
16
+ create_table "analysis_cases", :force => true do |t|
17
+ t.string "name"
18
+ t.string "description"
19
+ t.integer "verification_suite_id"
20
+ t.datetime "created_at", :null => false
21
+ t.datetime "updated_at", :null => false
22
+ end
23
+
24
+ create_table "case_tests", :force => true do |t|
25
+ t.string "description"
26
+ t.text "cmd"
27
+ t.integer "analysis_case_id"
28
+ t.datetime "created_at", :null => false
29
+ t.datetime "updated_at", :null => false
30
+ end
31
+
32
+ create_table "users", :force => true do |t|
33
+ t.string "full_name"
34
+ t.string "user_name"
35
+ t.string "email_address"
36
+ t.datetime "created_at", :null => false
37
+ t.datetime "updated_at", :null => false
38
+ end
39
+
40
+ create_table "verification_suites", :force => true do |t|
41
+ t.string "name"
42
+ t.text "description"
43
+ t.integer "user_id"
44
+ t.datetime "created_at", :null => false
45
+ t.datetime "updated_at", :null => false
46
+ end
47
+
48
+ end
data/db/seeds.rb ADDED
@@ -0,0 +1,4 @@
1
+ # encoding: UTF-8
2
+ require 'dtf-session'
3
+
4
+ User.create(full_name: "Library Owner", email_address: "library_owner@localhost.lan", user_name: "library_owner")
@@ -0,0 +1,28 @@
1
+ # encoding: UTF-8
2
+
3
+ # Application wide requirements
4
+ require 'active_record'
5
+ require 'active_model'
6
+ require 'active_support'
7
+ require 'multi_json'
8
+ require 'sqlite3'
9
+ require 'yaml'
10
+ require 'logger'
11
+ require 'thor'
12
+
13
+ # NOTE: Set RAILS_ENV to 'production' for ActiveRecord. Affects the database to use.
14
+ # Change this to 'development' while working on the gem itself, or set it in the
15
+ # environment prefixed to commands, in order to gain access to testing gems.
16
+ ENV['RAILS_ENV'] ||= 'development'
17
+
18
+ # Load the db config and create a connectoid. Make an ivar so its shared throughout the application
19
+ @dbconfig = YAML::load(File.open(File.join(File.dirname(__FILE__), '../../db/config.yml')))[ENV['RAILS_ENV']]
20
+
21
+ # Establish the database connection
22
+ ActiveRecord::Base.establish_connection(@dbconfig) # Line that actually connects the db.
23
+
24
+ # Load all the models
25
+ Dir["#{File.join(File.dirname(__FILE__), '../../app/models/*.rb')}"].each do |model|
26
+ load "#{model}"
27
+ end
28
+
@@ -0,0 +1,5 @@
1
+ module Dtf
2
+ module Session
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ require "dtf-session/version"
2
+ require 'thor'
3
+ require 'session'
4
+
5
+ module Dtf
6
+ load "#{File.join(File.dirname(__FILE__), "/config/environment.rb")}"
7
+
8
+ module Session
9
+ # Your code goes here...
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ # encoding: UTF-8
2
+
3
+ Fabricator(:analysis_case) do
4
+ name "DTF Analysis Case"
5
+ description "Fabricated AC for DTF testing"
6
+ case_tests(count: 3)
7
+ end
@@ -0,0 +1,6 @@
1
+ # encoding: UTF-8
2
+
3
+ Fabricator(:case_test) do
4
+ description "Fabricated CT for DTF testing"
5
+ cmd "ruby --version"
6
+ end
@@ -0,0 +1,8 @@
1
+ # encoding: UTF-8
2
+
3
+ Fabricator(:user) do
4
+ full_name { sequence(:num, 5 ) { |num| "John Q Public #{num}" } }
5
+ email_address { sequence(:email_address, 5) { |num| "jqp#{num}@public.com" } }
6
+ user_name { sequence(:user_name, 5) { |num| "johnpublic#{num}" } }
7
+ end
8
+
@@ -0,0 +1,6 @@
1
+ # encoding: UTF-8
2
+
3
+ Fabricator(:verification_suite) do
4
+ name "DTF Verification Suite"
5
+ description "Fabricated VS for DTF testing"
6
+ end
@@ -0,0 +1,66 @@
1
+ # encoding: UTF-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe "AnalysisCase" do
6
+
7
+ context "when instantiated" do
8
+
9
+ let(:analysis_case) { AnalysisCase.new }
10
+
11
+ it "should be the proper class" do
12
+ analysis_case.should be_a(AnalysisCase)
13
+ end
14
+
15
+ it "should be invalid without being assigned to a verification suite" do
16
+ analysis_case.should_not be_valid
17
+ analysis_case.errors.should_not be_empty
18
+ analysis_case[:verification_suite_id].should be_nil
19
+ analysis_case.new_record?.should be_true
20
+ end
21
+
22
+ it "should be invalid without a name" do
23
+ analysis_case.should_not be_valid
24
+ analysis_case.errors.should_not be_empty
25
+ analysis_case.errors.messages[:name].should eq(["can't be blank"])
26
+ analysis_case.new_record?.should be_true
27
+ end
28
+
29
+ it "should be invalid without a description" do
30
+ analysis_case.should_not be_valid
31
+ analysis_case.errors.should_not be_empty
32
+ analysis_case.errors.messages[:description].should eq(["can't be blank"])
33
+ analysis_case.new_record?.should be_true
34
+ end
35
+
36
+ it "should not be saved" do
37
+ analysis_case.new_record?.should be_true
38
+ analysis_case.persisted?.should_not be_true
39
+ end
40
+
41
+ end
42
+
43
+ context "when created" do
44
+ user = Fabricate(:user)
45
+ vs = user.verification_suites.create(name: "RSpec Test VS", description: "Bogus VS for RSpec")
46
+ analysis_case = vs.analysis_cases.create(name: "RSpec Test AC", description: "Bogus AC for RSpec")
47
+
48
+ it "should be owned by a verification suite" do
49
+ analysis_case.should be_valid
50
+ analysis_case.verification_suite_id.should_not be_nil
51
+ end
52
+
53
+ it "should have a valid name and description" do
54
+ analysis_case.should be_valid
55
+ analysis_case.errors.should be_empty
56
+ analysis_case.name.should_not be_nil
57
+ analysis_case.description.should_not be_nil
58
+ end
59
+
60
+ it "should be saved" do
61
+ analysis_case.should be_valid
62
+ analysis_case.new_record?.should_not be_true
63
+ analysis_case.persisted?.should be_true
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,69 @@
1
+ # encoding: UTF-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe "CaseTest" do
6
+
7
+ context "when instantiated" do
8
+
9
+ let(:case_test) { CaseTest.new }
10
+
11
+ it "should be the proper class" do
12
+ case_test.should be_a(CaseTest)
13
+ end
14
+
15
+ it "should be invalid without being assigned to a analysis case" do
16
+ case_test.should_not be_valid
17
+ case_test.errors.should_not be_empty
18
+ case_test[:analysis_case_id].should be_nil
19
+ case_test.new_record?.should be_true
20
+ end
21
+
22
+ it "should be invalid without a cmd" do
23
+ case_test.should_not be_valid
24
+ case_test.errors.should_not be_empty
25
+ case_test.errors.messages[:cmd].should eq(["can't be blank"])
26
+ case_test.new_record?.should be_true
27
+ end
28
+
29
+ it "should be invalid without a description" do
30
+ case_test.should_not be_valid
31
+ case_test.errors.should_not be_empty
32
+ case_test.errors.messages[:description].should eq(["can't be blank"])
33
+ case_test.new_record?.should be_true
34
+ end
35
+
36
+ it "should not be saved" do
37
+ case_test.new_record?.should be_true
38
+ case_test.persisted?.should_not be_true
39
+ end
40
+
41
+ end
42
+
43
+ context "when created" do
44
+ user = Fabricate(:user)
45
+ vs = user.verification_suites.create(name: "RSpec Test VS", description: "Bogus VS for RSpec")
46
+ analysis_case = vs.analysis_cases.create(name: "RSpec Test AC", description: "Bogus AC for RSpec")
47
+ case_test = analysis_case.case_tests.create(cmd: "bundle exec rspec spec",
48
+ description: "Bogus CT for RSpec"
49
+ )
50
+
51
+ it "should be owned by an analysis case" do
52
+ case_test.should be_valid
53
+ case_test.analysis_case_id.should_not be_nil
54
+ end
55
+
56
+ it "should have a valid cmd and description" do
57
+ case_test.should be_valid
58
+ case_test.errors.should be_empty
59
+ case_test.cmd.should_not be_nil
60
+ case_test.description.should_not be_nil
61
+ end
62
+
63
+ it "should be saved" do
64
+ case_test.should be_valid
65
+ case_test.new_record?.should_not be_true
66
+ case_test.persisted?.should be_true
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,59 @@
1
+ # encoding: UTF-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe "User" do
6
+
7
+ context "when instantiated" do
8
+
9
+ let(:user) { User.new }
10
+
11
+ it "should be the proper class" do
12
+ user.should be_a(User)
13
+ end
14
+
15
+ it "should be invalid without a user_name" do
16
+ user.should_not be_valid
17
+ user.errors.should_not be_empty
18
+ user.errors.messages[:user_name].should eq(["can't be blank"])
19
+ user.new_record?.should be_true
20
+ end
21
+
22
+ it "should be invalid without an email_address" do
23
+ user.should_not be_valid
24
+ user.errors.should_not be_empty
25
+ user.errors.messages[:email_address].should eq(["can't be blank"])
26
+ user.new_record?.should be_true
27
+ end
28
+
29
+ it "should be invalid without a full_name" do
30
+ user.should_not be_valid
31
+ user.errors.should_not be_empty
32
+ user.errors.messages[:full_name].should eq(["can't be blank"])
33
+ user.new_record?.should be_true
34
+ end
35
+
36
+ it "should not be saved" do
37
+ user.new_record?.should be_true
38
+ user.persisted?.should_not be_true
39
+ end
40
+
41
+ end
42
+
43
+ context "when created" do
44
+ let(:user) { Fabricate(:user)}
45
+
46
+ it "should have a valid user_name, full_name, and email_address" do
47
+ user.should be_valid
48
+ user.errors.should be_empty
49
+ user.user_name.should_not be_nil
50
+ user.full_name.should_not be_nil
51
+ user.email_address.should_not be_nil
52
+ end
53
+
54
+ it "should be saved" do
55
+ user.new_record?.should_not be_true
56
+ user.persisted?.should be_true
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,64 @@
1
+ # encoding: UTF-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe "VerificationSuite" do
6
+
7
+ context "when instantiated" do
8
+
9
+ let(:verification_suite) { VerificationSuite.new }
10
+
11
+ it "should be the proper class" do
12
+ verification_suite.should be_a(VerificationSuite)
13
+ end
14
+
15
+ it "should be invalid without being assigned to a user" do
16
+ verification_suite.should_not be_valid
17
+ verification_suite.errors.should_not be_empty
18
+ verification_suite[:user_id].should be_nil
19
+ verification_suite.new_record?.should be_true
20
+ end
21
+
22
+ it "should be invalid without a name" do
23
+ verification_suite.should_not be_valid
24
+ verification_suite.errors.should_not be_empty
25
+ verification_suite.errors.messages[:name].should eq(["can't be blank"])
26
+ verification_suite.new_record?.should be_true
27
+ end
28
+
29
+ it "should be invalid without a description" do
30
+ verification_suite.should_not be_valid
31
+ verification_suite.errors.should_not be_empty
32
+ verification_suite.errors.messages[:description].should eq(["can't be blank"])
33
+ verification_suite.new_record?.should be_true
34
+ end
35
+
36
+ it "should not be saved" do
37
+ verification_suite.new_record?.should be_true
38
+ verification_suite.persisted?.should_not be_true
39
+ end
40
+
41
+ end
42
+
43
+ context "when created" do
44
+ user = Fabricate(:user)
45
+ verification_suite = user.verification_suites.create(name: "RSpec Test VS", description: "Bogus VS for RSpec")
46
+
47
+ it "should be owned by a user" do
48
+ verification_suite.user_id.should_not be_nil
49
+ end
50
+
51
+ it "should have a valid name and description" do
52
+ verification_suite.should be_valid
53
+ verification_suite.errors.should be_empty
54
+ verification_suite.name.should_not be_nil
55
+ verification_suite.description.should_not be_nil
56
+ end
57
+
58
+ it "should be saved" do
59
+ verification_suite.should be_valid
60
+ verification_suite.new_record?.should_not be_true
61
+ verification_suite.persisted?.should be_true
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,34 @@
1
+ # encoding: UTF-8
2
+ require 'cover_me'
3
+ require 'dtf-session'
4
+ require 'rspec'
5
+ require 'fabrication'
6
+ require 'database_cleaner'
7
+
8
+ # Require any RSpec support files, helpers, and custom matchers we define
9
+ Dir[File.join(File.dirname(__FILE__), "support/**/*.rb")].each do |f|
10
+ require f
11
+ end
12
+
13
+ # Turnip steps load line
14
+ Dir.glob("spec/steps/**/*steps.rb") do |f|
15
+ load f, true
16
+ end
17
+
18
+ # This config section is for DatabaseCleaner
19
+ RSpec.configure do |config|
20
+
21
+ config.before(:suite) do
22
+ DatabaseCleaner.strategy = :transaction
23
+ DatabaseCleaner.clean_with(:truncation)
24
+ end
25
+
26
+ config.before(:each) do
27
+ DatabaseCleaner.start
28
+ end
29
+
30
+ config.after(:each) do
31
+ DatabaseCleaner.clean
32
+ end
33
+
34
+ end
metadata ADDED
@@ -0,0 +1,242 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dtf-session
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - David Deryl Downey
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-10-10 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: dtf
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
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: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: session
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: sqlite3
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: json
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: json_pure
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rspec
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: fabrication
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: yard
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ - !ruby/object:Gem::Dependency
159
+ name: redcarpet
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ description: dtf-session adds Bash session support to DTF
175
+ email:
176
+ - me@daviddwdowney.com
177
+ executables: []
178
+ extensions: []
179
+ extra_rdoc_files: []
180
+ files:
181
+ - lib/config/environment.rb
182
+ - lib/dtf-session/version.rb
183
+ - lib/dtf-session.rb
184
+ - Gemfile
185
+ - Gemfile.lock
186
+ - LICENSE
187
+ - Rakefile
188
+ - README.md
189
+ - spec/fabricators/analysis_case_fabricator.rb
190
+ - spec/fabricators/case_test_fabricator.rb
191
+ - spec/fabricators/user_fabricator.rb
192
+ - spec/fabricators/verification_suite_fabricator.rb
193
+ - spec/models/analysis_case_spec.rb
194
+ - spec/models/case_test_spec.rb
195
+ - spec/models/user_spec.rb
196
+ - spec/models/verification_suite_spec.rb
197
+ - spec/spec_helper.rb
198
+ - app/models/analysis_case.rb
199
+ - app/models/case_test.rb
200
+ - app/models/user.rb
201
+ - app/models/verification_suite.rb
202
+ - db/config.yml
203
+ - db/dtf_session_development.sqlite3
204
+ - db/dtf_session_test.sqlite3
205
+ - db/schema.rb
206
+ - db/seeds.rb
207
+ homepage: https://github.com/dtf-gems/dtf-session
208
+ licenses: []
209
+ post_install_message:
210
+ rdoc_options: []
211
+ require_paths:
212
+ - lib
213
+ required_ruby_version: !ruby/object:Gem::Requirement
214
+ none: false
215
+ requirements:
216
+ - - ! '>='
217
+ - !ruby/object:Gem::Version
218
+ version: 1.9.2
219
+ required_rubygems_version: !ruby/object:Gem::Requirement
220
+ none: false
221
+ requirements:
222
+ - - ! '>='
223
+ - !ruby/object:Gem::Version
224
+ version: '0'
225
+ requirements: []
226
+ rubyforge_project:
227
+ rubygems_version: 1.8.24
228
+ signing_key:
229
+ specification_version: 3
230
+ summary: dtf-session adds Bash Session gem support for commandline based testing to
231
+ DTF.
232
+ test_files:
233
+ - spec/fabricators/analysis_case_fabricator.rb
234
+ - spec/fabricators/case_test_fabricator.rb
235
+ - spec/fabricators/user_fabricator.rb
236
+ - spec/fabricators/verification_suite_fabricator.rb
237
+ - spec/models/analysis_case_spec.rb
238
+ - spec/models/case_test_spec.rb
239
+ - spec/models/user_spec.rb
240
+ - spec/models/verification_suite_spec.rb
241
+ - spec/spec_helper.rb
242
+ has_rdoc: