motion-spec 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.rubocop.yml +13 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/lib/motion-spec/context.rb +10 -2
- data/lib/motion-spec/extensions/exception.rb +1 -1
- data/lib/motion-spec/version.rb +1 -1
- data/lib/motion-spec.rb +19 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODlmZDBkZDQ2ODE2ODhiMzBmZGZiNzM5NmNmMTZlM2NmYmFhYTJiMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODIyMWE2MTExNjU3ZGQ4N2FhZjVlZDE5ZjI2ODdkOTBlMDcxNTFkOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Y2Y5NmUzYzE5NDgzZGE5MDljMDE1MGE0Zjg0OTEyMDQ0NTZlNTk5YTFhYjIy
|
10
|
+
NTNhNjdmNTA1YjQxZTkzNWNkMDdkZTAzOTkxMjRhM2ZmZTQ1Y2Y2ZTNiOWVj
|
11
|
+
ODRhNjNmNTc5MDg5OGEyY2M0YTE2YjQ2ZjM0NjUyMWIzMjE1M2U=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTY2NTUzNmNlM2M3MDIyMjRlYTU5YjUwMTgyNGZhYzcwMDgxOTNjNmQ2Njky
|
14
|
+
OTUyZjg5MGE2YWQxMWE5MTk4OWNjY2Q4OWUxYzllZjlhY2JhYTYzZmUyOTZm
|
15
|
+
NzA1NTgyYjg1YjkzNWFmMzIzYjEwZjQ4ZDAxMjAxN2Q5ZDhiMGI=
|
data/.rubocop.yml
CHANGED
@@ -54,5 +54,18 @@ Style/IndentationWidth:
|
|
54
54
|
Style/MethodName:
|
55
55
|
Enabled: false
|
56
56
|
|
57
|
+
Style/StringLiterals:
|
58
|
+
Description: Checks if uses of quotes match the configured preference.
|
59
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
60
|
+
Enabled: true
|
61
|
+
EnforcedStyle: single_quotes
|
62
|
+
|
63
|
+
Style/StringLiteralsInInterpolation:
|
64
|
+
Description: >-
|
65
|
+
Checks if uses of quotes inside expressions in interpolated
|
66
|
+
strings match the configured preference.
|
67
|
+
Enabled: true
|
68
|
+
EnforcedStyle: single_quotes
|
69
|
+
|
57
70
|
Style/VariableName:
|
58
71
|
Enabled: false
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# MotionSpec
|
2
|
+
[![App Version](https://img.shields.io/gem/v/motion-spec.svg)](https://rubygems.org/gems/motion-spec)
|
2
3
|
[![Build Status](https://img.shields.io/travis/jbender/motion-spec/master.svg)](https://travis-ci.org/jbender/motion-spec)
|
3
4
|
[![Code Climate](https://img.shields.io/codeclimate/github/jbender/motion-spec.svg)](https://codeclimate.com/github/jbender/motion-spec)
|
4
|
-
[![MIT Licensed](https://img.shields.io/github/license/jbender/motion-spec.svg)](https://github.com/jbender/motion-spec/blob/master/LICENSE)
|
5
5
|
[![Dependency Status](https://img.shields.io/gemnasium/jbender/motion-spec.svg)](https://gemnasium.com/jbender/motion-spec)
|
6
|
+
[![MIT Licensed](https://img.shields.io/github/license/jbender/motion-spec.svg)](https://github.com/jbender/motion-spec/blob/master/LICENSE)
|
6
7
|
|
7
8
|
Specs are important! This project makes them a first-class citizen again.
|
8
9
|
|
data/lib/motion-spec/context.rb
CHANGED
@@ -53,8 +53,16 @@ module MotionSpec
|
|
53
53
|
@after << block
|
54
54
|
end
|
55
55
|
|
56
|
-
def
|
57
|
-
|
56
|
+
def it_behaves_like(name, &block)
|
57
|
+
describe("behaves like #{name}") do
|
58
|
+
include_examples(name)
|
59
|
+
instance_eval(&block) if block_given?
|
60
|
+
end
|
61
|
+
end
|
62
|
+
alias_method :behaves_like, :it_behaves_like
|
63
|
+
|
64
|
+
def include_examples(name)
|
65
|
+
instance_eval(&Shared[name])
|
58
66
|
end
|
59
67
|
|
60
68
|
def it(description, &block)
|
@@ -1,2 +1,2 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
Exception.log_exceptions = false if Exception.respond_to? :log_exceptions
|
2
|
+
Exception.log_exceptions = false if Exception.respond_to? :log_exceptions=
|
data/lib/motion-spec/version.rb
CHANGED
data/lib/motion-spec.rb
CHANGED
@@ -7,25 +7,33 @@ require 'motion-require'
|
|
7
7
|
|
8
8
|
# Proper load order of all the classes/modules
|
9
9
|
###
|
10
|
+
def require_lib_file(file)
|
11
|
+
case file
|
12
|
+
when String
|
13
|
+
files = expanded_file_path(file)
|
14
|
+
files = Dir.glob(files) if file.include? '*'
|
15
|
+
when Array
|
16
|
+
files = file.map { |f| expanded_file_path(f) }
|
17
|
+
end
|
18
|
+
|
19
|
+
Motion::Require.all(files)
|
20
|
+
end
|
21
|
+
|
22
|
+
def expanded_file_path(file)
|
23
|
+
File.expand_path("../motion-spec/#{file}.rb", __FILE__)
|
24
|
+
end
|
10
25
|
|
11
26
|
# Let's start off with what version we're running
|
12
|
-
|
27
|
+
require_lib_file('version')
|
13
28
|
|
14
29
|
# Load the output before the core so the core knows how to print
|
15
|
-
|
30
|
+
require_lib_file('output/*')
|
16
31
|
|
17
32
|
# All the other core modules in the proper order
|
18
|
-
|
19
|
-
'lib/motion-spec/core.rb',
|
20
|
-
'lib/motion-spec/error.rb',
|
21
|
-
'lib/motion-spec/specification.rb',
|
22
|
-
'lib/motion-spec/platform.rb',
|
23
|
-
'lib/motion-spec/context.rb',
|
24
|
-
'lib/motion-spec/should.rb'
|
25
|
-
])
|
33
|
+
require_lib_file(%w(core error specification platform context should))
|
26
34
|
|
27
35
|
# Monkeypatch core objects to respond to test methods
|
28
|
-
|
36
|
+
require_lib_file('extensions/*')
|
29
37
|
|
30
38
|
# FIXME : Need better detection for iPhone Simulator
|
31
39
|
if defined?(UIDevice) &&
|