cucumber_monitor 0.0.3 → 0.0.4

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.
@@ -0,0 +1,21 @@
1
+ require 'test_helper'
2
+
3
+ class FeatureFileTest < ActiveSupport::TestCase
4
+
5
+ test "features should have the attributes name, file and description" do
6
+ assert_equal 'administration', @feature_one.name
7
+ assert_equal 'administration.feature', @feature_one.file
8
+ assert_equal 'Access the system as an administrator', @feature_one.description
9
+ end
10
+
11
+ test "feature should return its scenarios" do
12
+ assert_equal 2, @feature_one.scenarios.size
13
+ assert_equal 'Access with valid data', @feature_one.scenarios[0].name
14
+ assert_equal 'Access with invalid data', @feature_one.scenarios[1].name
15
+ end
16
+
17
+ test "feature should return its contexts when applicable" do
18
+ assert_equal 1, @feature_two.contexts.size
19
+ end
20
+
21
+ end
@@ -0,0 +1,23 @@
1
+ require 'test_helper'
2
+
3
+ class ScenarioTest < ActiveSupport::TestCase
4
+
5
+ test "scenario should return its steps" do
6
+ assert_equal 3, @feature_one.scenarios.first.steps.size
7
+
8
+ step_1 = 'Given that there is an administrator with the email "admin@domain.com" and password "123456"'
9
+ step_2 = 'When I try to access the admin dashboard with the email "admin@domain.com" and senha "123456"'
10
+ step_3 = 'Then I should be at admin dashboard page'
11
+
12
+ assert_equal step_1, @feature_one.scenarios.first.steps[0].description
13
+ assert_equal step_2, @feature_one.scenarios.first.steps[1].description
14
+ assert_equal step_3, @feature_one.scenarios.first.steps[2].description
15
+ end
16
+
17
+ test 'should find steps within scenario by searching' do
18
+ assert_equal 3, @feature_one.scenarios.first.steps.where(description: 'a').size
19
+ step = 'Then I should be at admin dashboard page'
20
+ assert_equal step, @feature_one.scenarios.first.steps.where(description: 'dashboard page').description
21
+ end
22
+
23
+ end
data/test/setup.rb ADDED
@@ -0,0 +1,7 @@
1
+ class Test::Unit::TestCase
2
+ def setup
3
+ @cucumber = CucumberMonitor.new
4
+ @feature_one = @cucumber.features.first
5
+ @feature_two = @cucumber.features.last
6
+ end
7
+ end
data/test/step_test.rb ADDED
@@ -0,0 +1,36 @@
1
+ require 'test_helper'
2
+
3
+ class StepTest < ActiveSupport::TestCase
4
+
5
+ test "step should return its siblings" do
6
+ step = @feature_one.scenarios.first.steps.first
7
+
8
+ siblings = [
9
+ 'Given that there is an administrator with the email "admin@domain.com" and password "123456"',
10
+ 'When I try to access the admin dashboard with the email "admin@domain.com" and senha "123456"',
11
+ 'Then I should be at admin dashboard page',
12
+ ]
13
+ assert_equal siblings, step.siblings_and_self.map(&:description)
14
+ end
15
+
16
+ test "step should get the previous step" do
17
+ last_step = @feature_one.scenarios.first.steps.last
18
+ previous_step = 'When I try to access the admin dashboard with the email "admin@domain.com" and senha "123456"'
19
+ assert_equal previous_step, last_step.previous.description
20
+ end
21
+
22
+ test "step should get the next step" do
23
+ first_step = @feature_one.scenarios.first.steps.first
24
+ next_step = 'When I try to access the admin dashboard with the email "admin@domain.com" and senha "123456"'
25
+ assert_equal next_step, first_step.next.description
26
+ end
27
+
28
+ test "step should return empty array when there is no next or previous step" do
29
+ first_step = @feature_one.scenarios.first.steps.first
30
+ last_step = @feature_one.scenarios.first.steps.last
31
+
32
+ assert_equal [], first_step.previous
33
+ assert_equal [], last_step.next
34
+ end
35
+
36
+ end
data/test/test_helper.rb CHANGED
@@ -4,6 +4,8 @@ ENV["RAILS_ENV"] = "test"
4
4
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
5
  require "rails/test_help"
6
6
 
7
+ require File.expand_path(File.dirname(__FILE__) + '/setup')
8
+
7
9
  Rails.backtrace_cleaner.remove_silencers!
8
10
 
9
11
  # Load support files
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
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-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -49,10 +49,13 @@ executables: []
49
49
  extensions: []
50
50
  extra_rdoc_files: []
51
51
  files:
52
+ - app/assets/images/cucumber_monitor/ajax-loader.gif
53
+ - app/assets/javascripts/cucumber_monitor/cucumber_monitor.js.erb
52
54
  - app/assets/stylesheets/cucumber_monitor/application.css
53
55
  - app/assets/stylesheets/cucumber_monitor/cucumber_monitor.css
54
56
  - app/controllers/cucumber_monitor_controller.rb
55
57
  - app/views/cucumber_monitor/_search_form.html.erb
58
+ - app/views/cucumber_monitor/feature_runner.js.erb
56
59
  - app/views/cucumber_monitor/features.html.erb
57
60
  - app/views/cucumber_monitor/search.html.erb
58
61
  - app/views/cucumber_monitor/show_feature.html.erb
@@ -65,6 +68,7 @@ files:
65
68
  - lib/cucumber_monitor/context.rb
66
69
  - lib/cucumber_monitor/engine.rb
67
70
  - lib/cucumber_monitor/feature_file.rb
71
+ - lib/cucumber_monitor/feature_runner.rb
68
72
  - lib/cucumber_monitor/scenario.rb
69
73
  - lib/cucumber_monitor/step.rb
70
74
  - lib/cucumber_monitor/string.rb
@@ -74,6 +78,8 @@ files:
74
78
  - MIT-LICENSE
75
79
  - Rakefile
76
80
  - README.rdoc
81
+ - test/base_test.rb
82
+ - test/context_test.rb
77
83
  - test/cucumber_monitor_test.rb
78
84
  - test/dummy/app/assets/javascripts/application.js
79
85
  - test/dummy/app/assets/stylesheets/application.css
@@ -96,6 +102,9 @@ files:
96
102
  - test/dummy/config/locales/en.yml
97
103
  - test/dummy/config/routes.rb
98
104
  - test/dummy/config.ru
105
+ - test/dummy/db/development.sqlite3
106
+ - test/dummy/db/test.sqlite3
107
+ - test/dummy/log/test.log
99
108
  - test/dummy/public/404.html
100
109
  - test/dummy/public/422.html
101
110
  - test/dummy/public/500.html
@@ -103,7 +112,11 @@ files:
103
112
  - test/dummy/Rakefile
104
113
  - test/dummy/README.rdoc
105
114
  - test/dummy/script/rails
115
+ - test/feature_file_test.rb
106
116
  - test/integration/navigation_test.rb
117
+ - test/scenario_test.rb
118
+ - test/setup.rb
119
+ - test/step_test.rb
107
120
  - test/test_helper.rb
108
121
  homepage: http://www.webhall.com.br
109
122
  licenses: []
@@ -131,6 +144,8 @@ specification_version: 3
131
144
  summary: Puts your features in a highlighted position. Adds a dashboard for viewing,
132
145
  searching and better identification of yours scenarios and steps.
133
146
  test_files:
147
+ - test/base_test.rb
148
+ - test/context_test.rb
134
149
  - test/cucumber_monitor_test.rb
135
150
  - test/dummy/app/assets/javascripts/application.js
136
151
  - test/dummy/app/assets/stylesheets/application.css
@@ -153,6 +168,9 @@ test_files:
153
168
  - test/dummy/config/locales/en.yml
154
169
  - test/dummy/config/routes.rb
155
170
  - test/dummy/config.ru
171
+ - test/dummy/db/development.sqlite3
172
+ - test/dummy/db/test.sqlite3
173
+ - test/dummy/log/test.log
156
174
  - test/dummy/public/404.html
157
175
  - test/dummy/public/422.html
158
176
  - test/dummy/public/500.html
@@ -160,5 +178,9 @@ test_files:
160
178
  - test/dummy/Rakefile
161
179
  - test/dummy/README.rdoc
162
180
  - test/dummy/script/rails
181
+ - test/feature_file_test.rb
163
182
  - test/integration/navigation_test.rb
183
+ - test/scenario_test.rb
184
+ - test/setup.rb
185
+ - test/step_test.rb
164
186
  - test/test_helper.rb