aktion_test 0.3.0 → 0.3.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.
@@ -1,3 +1,6 @@
1
+ # v0.3.1
2
+ * Remove simplecov dep from AktionTest module and load it manually for ourselves
3
+
1
4
  # v0.3.0
2
5
  * New spec helper interface, more OOPish this time
3
6
  * Modules receive the spec helper instance in their initialize to load dependencies
@@ -12,15 +12,11 @@ module AktionTest
12
12
  end
13
13
 
14
14
  def failure_message
15
- raise "Called failure message before determining a match from #{caller[0]}" if @matches.nil?
16
- raise "Called failure message while the match was positive from #{caller[0]}" if @matches
17
- "Expected #{expectation}\n#{problems_for_should}\n"
15
+ message(false)
18
16
  end
19
17
 
20
18
  def negative_failure_message
21
- raise "Called negative failure message before determining a match from #{caller[0]}" if @matches.nil?
22
- raise "Called negative failure message while the match was unsucessful from #{caller[0]}" unless @matches
23
- "Did not expect #{expectation}\n#{problems_for_should_not}\n"
19
+ message(true)
24
20
  end
25
21
 
26
22
  protected
@@ -40,6 +36,19 @@ module AktionTest
40
36
  def perform_match!
41
37
  raise "Override perform_match! with your custom matching logic. The subject is available through @subject"
42
38
  end
39
+
40
+ private
41
+
42
+ def message(match)
43
+ check_match(match)
44
+ "#{match ? 'Did not expect' : 'Expected'} #{expectation}\n#{send(match ? :problems_for_should_not : :problems_for_should)}\n"
45
+ end
46
+
47
+ def check_match(match)
48
+ method = match ? 'negative failure message' : 'failure message'
49
+ raise "Called #{method} before determining a match from #{caller[0]} " if @matches.nil?
50
+ raise "Called #{method} while the match was #{match ? 'negative' : 'positive'} from #{caller[0]}" unless @matches == match
51
+ end
43
52
  end
44
53
  end
45
54
  end
@@ -3,7 +3,6 @@ module AktionTest
3
3
  class AktionTest < Base
4
4
  def initialize(spec, options={})
5
5
  super
6
- spec.use :Simplecov
7
6
  end
8
7
 
9
8
  def prepare
@@ -1,3 +1,3 @@
1
1
  module AktionTest
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -2,9 +2,13 @@ $: << File.dirname(__FILE__)
2
2
  require 'aktion_test'
3
3
  require 'support/autoload'
4
4
 
5
+ require 'simplecov'
6
+ SimpleCov.start do
7
+ add_group 'Matchers', 'lib/aktion_test/matchers'
8
+ add_group 'Modules', 'lib/aktion_test/module'
9
+ end
10
+
5
11
  AktionTest::SpecHelper.build do
6
12
  use :AktionTest, :FactoryGirl, :Faker, :RSpec, :Timecop
7
13
  end
8
14
 
9
- SimpleCov.add_group 'Matchers', 'lib/aktion_test/matchers'
10
- SimpleCov.add_group 'Modules', 'lib/aktion_test/module'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aktion_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -154,12 +154,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  - - ! '>='
155
155
  - !ruby/object:Gem::Version
156
156
  version: '0'
157
- segments:
158
- - 0
159
- hash: -615248081
160
157
  requirements: []
161
158
  rubyforge_project:
162
- rubygems_version: 1.8.25
159
+ rubygems_version: 1.8.24
163
160
  signing_key:
164
161
  specification_version: 3
165
162
  summary: Gems, libs, helpers for test suites.