auto_test 0.0.8.9.0 → 0.0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/auto_test.rb CHANGED
@@ -16,12 +16,8 @@ module AutoTest
16
16
  self.configuration ||= Configuration.new
17
17
  yield(configuration)
18
18
  end
19
- def self.start_rspec
20
- path = (%x(gem which auto_test))
21
- path = path[0..path.size-13]
22
- puts path
23
- exec("rspec '#{path}/../spec/requests/auto_spec.rb' -o '#{path}/../../log/rspec.txt'")
24
- end
19
+
20
+
25
21
 
26
22
  class Configuration
27
23
  def initialize
@@ -1,3 +1,3 @@
1
1
  module AutoTest
2
- VERSION = "0.0.8.9.0"
2
+ VERSION = "0.0.9.1"
3
3
  end
@@ -11,9 +11,7 @@ describe "Application" do
11
11
 
12
12
  describe "auto_test" do
13
13
  it "does test the application automatically" do
14
- puts "in rspec"
15
14
  load "#{Rails.root}/db/test_seeds.rb"
16
- puts "autotest"
17
15
  t = AutoTest::TestStarter.new
18
16
  t.test
19
17
  end
@@ -4,16 +4,19 @@ namespace :auto_test do
4
4
  task :test do
5
5
  puts "Running auto_test..."
6
6
  sh "rails server -e test -p 3002 -d"
7
- AutoTest.start_rspec
8
- # sh "rspec lib/spec/requests/auto_spec.rb -o 'log/rspec.txt'"
9
- #sh "rm 'log/rspec.txt'"
7
+ path = sh "gem which auto_test"
8
+ path = path[0..path.size-13]
9
+ sh "rspec '#{path}/../spec/requests/auto_spec.rb' -o '#{path}/../../log/rspec.txt'")
10
10
  Rake::Task[:error_calc].invoke
11
11
  Rake::Task[:stop].invoke
12
12
  end
13
13
 
14
14
  desc "calculating the errors"
15
15
  task :error_calc do
16
- err = File.read("log/errors.log")
16
+ path = sh "gem which auto_test"
17
+ path = path[0..path.size-13]
18
+ sh "rm '#{path}/../log/rspec.txt'"
19
+ err = File.read("#{path}/../log/errors.log")
17
20
  if err.to_i > 0 then
18
21
  puts "Do you want to see the error-path in firefox? Type yes/no:"
19
22
  a = STDIN.gets.chomp
@@ -25,23 +28,27 @@ namespace :auto_test do
25
28
 
26
29
  desc "Reducing the error path"
27
30
  task :reduce_errors do
31
+ path = sh "gem which auto_test"
32
+ path = path[0..path.size-13]
28
33
  puts "Reducing the error path, this could take a while..."
29
- sh "rspec lib/spec/requests/error_reduction_spec.rb -o 'log/reduce_err.txt'"
30
- sh "rm 'log/reduce_err.txt'"
34
+ sh "rspec #{path}/spec/requests/error_reduction_spec.rb -o '#{path}/../log/reduce_err.txt'"
35
+ sh "rm '#{path}/../log/reduce_err.txt'"
31
36
  Rake::Task[:start_action_path].invoke
32
37
  end
33
38
 
34
39
  desc "starting the simulation"
35
40
  task :start_action_path do
41
+ path = sh "gem which auto_test"
42
+ path = path[0..path.size-13]
36
43
  # paths = File.new("lib/auto_test/log/new_path.log")
37
44
  # n = 0
38
45
  # while line = paths.gets do
39
46
  # n = n + 1
40
47
  # end
41
48
  # puts "Error path reduced.There are #{n} paths to be visited."
42
- # puts "Press Enter to see the path in Firefox! "
43
- # STDIN.gets
44
- ruby 'lib/simulation.rb'
49
+ puts "Press Enter to see the path in Firefox! "
50
+ STDIN.gets
51
+ ruby "#{path}/simulation.rb"
45
52
  end
46
53
 
47
54
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: auto_test
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.8.9.0
5
+ version: 0.0.9.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Maike Hargens
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-10-02 00:00:00 Z
13
+ date: 2012-10-03 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faker