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.
- data/CHANGELOG.md +3 -0
- data/lib/aktion_test/matchers/base.rb +15 -6
- data/lib/aktion_test/module/aktion_test.rb +0 -1
- data/lib/aktion_test/version.rb +1 -1
- data/spec/spec_helper.rb +6 -2
- metadata +2 -5
data/CHANGELOG.md
CHANGED
@@ -12,15 +12,11 @@ module AktionTest
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def failure_message
|
15
|
-
|
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
|
-
|
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
|
data/lib/aktion_test/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -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.
|
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.
|
159
|
+
rubygems_version: 1.8.24
|
163
160
|
signing_key:
|
164
161
|
specification_version: 3
|
165
162
|
summary: Gems, libs, helpers for test suites.
|