wagn 1.19.4 → 1.19.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 930af46a0694af083fa46463e65ad2bfaa38120f
4
- data.tar.gz: 3fa000fd4686922c15005c424dc5d7d850f75a45
3
+ metadata.gz: f024b8b0001ddf5423ba011ef9b18d7f3c7f9bf5
4
+ data.tar.gz: 92e141058800ba4e50beabe7156440187f630735
5
5
  SHA512:
6
- metadata.gz: 6e723b5b89bb19c4bb3f0f186f1d1fdd2d7aa2ee35d6722c9d55dd358b04d759328a857c024f3fc5bd91bdcab3871553e2f7c5eef2214f06b87a8d5b9b3ec32b
7
- data.tar.gz: c428b64ee754c681390a235f318c2e4685a277b6b137c32cdf617701d9750f1e2669fdd40de9752b70649cf1ccec11956e0455b0d27cfc6a69f30d551c09d5dd
6
+ metadata.gz: 54509726919a4016e20a534a09b6cd0a1311b68f4785a43cb4d32d5928bf2489861d9f13087aac3aa78099c83acefb262fdb052c49a6ab763b0ce04bcad2ad9a
7
+ data.tar.gz: ac23218fc2d08965e7c9daa3586b8d40acd11bdba863aebccf3a11ec8ee08dbfe1e8bc5efb2904930bb2b784ac2dc557e79fc915c814fdb7475cd830681e8ab8
@@ -1,7 +1,8 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  ENV["RAILS_ENV"] = "cucumber"
3
3
 
4
- require File.expand_path("../../../lib/wagn/simplecov_helper.rb", __FILE__)
4
+ require "wagn"
5
+ require File.join Wagn.card_gem_root, "spec/support/simplecov_helper.rb"
5
6
  require "simplecov"
6
7
  require "minitest/autorun"
7
8
 
@@ -22,5 +22,20 @@ module Wagn
22
22
  def gem_root
23
23
  WAGN_GEM_ROOT
24
24
  end
25
+
26
+ def card_gem_root
27
+ @card_gem_root ||= locate_gem "card"
28
+ end
29
+
30
+ private
31
+
32
+ def locate_gem name
33
+ spec = Bundler.load.specs.find { |s| s.name == name }
34
+ unless spec
35
+ raise GemNotFound, "Could not find gem '#{name}' in the current bundle."
36
+ end
37
+ return File.expand_path("../../../", __FILE__) if spec.name == "bundler"
38
+ spec.full_gem_path
39
+ end
25
40
  end
26
41
  end
@@ -87,7 +87,10 @@ else
87
87
  rspec_args.shift
88
88
  opts = {}
89
89
  Wagn::Parser.rspec(opts).parse!(wagn_args)
90
-
90
+ # no coverage if rspec was started with file argument
91
+ if (opts[:files] || rspec_args.present?) && !opts[:simplecov]
92
+ opts[:simplecov] = "COVERAGE=false"
93
+ end
91
94
  rspec_command =
92
95
  "RAILS_ROOT=. #{opts[:simplecov]} #{opts[:executer]} " \
93
96
  " #{opts[:rescue]} rspec #{rspec_args.shelljoin} #{opts[:files]} "\
@@ -1,65 +1,23 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  # require 'codeclimate-test-reporter'
3
3
  # CodeClimate::TestReporter.start
4
- require "spork"
5
4
 
6
- ENV["RAILS_ENV"] = "test"
5
+ require "wagn" # only for card_gem_root
6
+ require File.join Wagn.card_gem_root, "spec/support/card_spec_loader.rb"
7
7
 
8
- Spork.prefork do
9
- if ENV["RAILS_ROOT"]
10
- require File.join(ENV["RAILS_ROOT"], "/config/environment")
11
- else
12
- require File.expand_path("../../config/environment", __FILE__)
13
- end
14
- require File.join Cardio.gem_root, "config", "simplecov_helper.rb"
8
+ CardSpecLoader.init
15
9
 
10
+ CardSpecLoader.prefork do
16
11
  if defined?(Bundler)
17
- Bundler.require(:test) # if simplecov is activated in the Gemfile, it has to be required here
12
+ Bundler.require(:test)
13
+ # if simplecov is activated in the Gemfile, it has to be required here
18
14
  end
19
-
20
- require "rspec/rails"
21
-
22
- # Requires supporting ruby files with custom matchers and macros, etc,
23
- # in spec/support/ and its subdirectories.
24
- # Dir[ File.join(Wagn.gem_root, "spec/support/**/*.rb") ].each { |f| require f }
25
-
26
15
  # FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures'
27
- JOE_USER_ID = Card["joe_user"].id
28
-
29
- RSpec.configure do |config|
30
- config.include RSpec::Rails::Matchers::RoutingMatchers, file_path: /\bspec\/controllers\//
31
- config.infer_spec_type_from_file_location!
32
- # format_index = ARGV.find_index {|arg| arg =~ /--format/ }
33
- # formatter = format_index ? ARGV[ format_index + 1 ] : 'documentation'
34
- # config.add_formatter formatter
35
-
36
- # config.include CustomMatchers
37
- # config.include ControllerMacros, type: :controllers
38
-
39
- # == Mock Framework
40
- # If you prefer to mock with mocha, flexmock or RR, uncomment the appropriate symbol:
41
- # :mocha, :flexmock, :rr
42
-
43
- # config.mock_with :rr
44
-
45
- config.use_transactional_fixtures = true
46
- config.use_instantiated_fixtures = false
47
-
48
- config.before(:each) do
49
- Card::Auth.current_id = JOE_USER_ID
50
- Card::Cache.restore
51
- Card::Env.reset
52
- end
53
- config.after(:each) do
54
- Timecop.return
55
- end
56
- end
16
+ CardSpecLoader.rspec_config
57
17
  end
58
18
 
59
- Spork.each_run do
19
+ CardSpecLoader.each_run do
60
20
  # This code will be run each time you run your specs.
61
21
  end
62
22
 
63
- require File.join Cardio.gem_root, "spec", "card_spec_helper.rb"
64
-
65
- RSpec::Core::ExampleGroup.send :include, Card::SpecHelper
23
+ CardSpecLoader.helper
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wagn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.4
4
+ version: 1.19.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-09-14 00:00:00.000000000 Z
14
+ date: 2016-09-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -33,14 +33,14 @@ dependencies:
33
33
  requirements:
34
34
  - - '='
35
35
  - !ruby/object:Gem::Version
36
- version: 1.19.4
36
+ version: 1.19.5
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - '='
42
42
  - !ruby/object:Gem::Version
43
- version: 1.19.4
43
+ version: 1.19.5
44
44
  description: a wiki approach to stuctured data, dynamic interaction, and web design
45
45
  email:
46
46
  - info@wagn.org
@@ -156,7 +156,6 @@ files:
156
156
  - lib/wagn/parser.rb
157
157
  - lib/wagn/response.rb
158
158
  - lib/wagn/script_wagn_loader.rb
159
- - lib/wagn/simplecov_helper.rb
160
159
  - lib/wagn/tasks/.gitkeep
161
160
  - lib/wagn/tasks/cucumber.rake
162
161
  - lib/wagn/tasks/db.rake
@@ -1,60 +0,0 @@
1
- def card_simplecov_filters
2
- add_filter "spec/"
3
- add_filter "/config/"
4
- add_filter "/tasks/"
5
-
6
- # filter all card mods
7
- add_filter do |src_file|
8
- src_file.filename =~ /tmp\// && !/\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/**/#{m[1]}"].present? }
9
- end
10
-
11
- # add group for each deck mod
12
- Dir["mod/*"].map { |path| path.sub("mod/", "") }.each do |mod|
13
- add_group mod.capitalize do |src_file|
14
- src_file.filename =~ /mod\/#{mod}\// ||
15
- (
16
- src_file.filename =~ /tmp\// &&
17
- /\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/#{mod}/**/#{m[1]}"].present? }
18
- )
19
- end
20
- end
21
-
22
- add_group "Sets" do |src_file|
23
- src_file.filename =~ /tmp\/set\// &&
24
- /\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/**/#{m[1]}"].present? }
25
- end
26
- add_group "Set patterns" do |src_file|
27
- src_file.filename =~ /tmp\/set_pattern\// &&
28
- /\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/**/#{m[1]}"].present? }
29
- end
30
- add_group "Formats" do |src_file|
31
- src_file.filename =~ /mod\/[^\/]+\/formats/
32
- end
33
- add_group "Chunks" do |src_file|
34
- src_file.filename =~ /mod\/[^\/]+\/chunks/
35
- end
36
- end
37
-
38
- def card_core_dev_simplecov_filters
39
- filters.clear # This will remove the :root_filter that comes via simplecov's defaults
40
- add_filter do |src|
41
- !(src.filename =~ /^#{SimpleCov.root}/) unless src.filename =~ /wagn/
42
- end
43
-
44
- add_filter "/spec/"
45
- add_filter "/features/"
46
- add_filter "/config/"
47
- add_filter "/tasks/"
48
- add_filter "/generators/"
49
- add_filter "lib/card"
50
-
51
- add_group "Card", "lib/card"
52
- add_group "Set Patterns", "tmp/set_pattern/"
53
- add_group "Sets", "tmp/set/"
54
- add_group "Formats" do |src_file|
55
- src_file.filename =~ /mod\/[^\/]+\/format/
56
- end
57
- add_group "Chunks" do |src_file|
58
- src_file.filename =~ /mod\/[^\/]+\/chunk/
59
- end
60
- end