motion-spec 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGJkZjNkZGM5YWUxMzcwYjkzOTY2Y2U3YmMwNmVjMGIwY2RmZGNiYg==
4
+ ODlmZDBkZDQ2ODE2ODhiMzBmZGZiNzM5NmNmMTZlM2NmYmFhYTJiMA==
5
5
  data.tar.gz: !binary |-
6
- ZGUyNDg4ZmY1NWYwNDNmMGUzNGY2ZDg1NzFhM2QxZjBkYzA4NTRhOQ==
6
+ ODIyMWE2MTExNjU3ZGQ4N2FhZjVlZDE5ZjI2ODdkOTBlMDcxNTFkOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTEzYTc5MjI5Y2M1MjA2NjQyNjAzODM0YzE5N2VjMDc3MTYxMGUwOWM3NWQw
10
- Y2U1MmRkZTY1ZDJlYjFmMzFmYzc4YzlmNTVlZDI1ZTUxMWEwMWU4NWIxN2Yy
11
- NzhlZTFjN2Q3YWNmNzhlMWFmZmRjODY3YTczZTFmZWNkNGJjYjI=
9
+ Y2Y5NmUzYzE5NDgzZGE5MDljMDE1MGE0Zjg0OTEyMDQ0NTZlNTk5YTFhYjIy
10
+ NTNhNjdmNTA1YjQxZTkzNWNkMDdkZTAzOTkxMjRhM2ZmZTQ1Y2Y2ZTNiOWVj
11
+ ODRhNjNmNTc5MDg5OGEyY2M0YTE2YjQ2ZjM0NjUyMWIzMjE1M2U=
12
12
  data.tar.gz: !binary |-
13
- NmYyYzE5YWVlNmY5MjRhODY0ZDc3YjIwNGQ3NWE0NDc1MmM4MmYzOTg0MGI2
14
- ZTY3N2FiNDQzOTQ2OWFhN2YzZThlZjZhMTFhNTRmMjg2NzRiMTc1NzZiMGJk
15
- ZmU3NzcyOWEzMGZmZDY3YjA0OTVkODMxYWVhOGNmZGQ3ZGU2ZWM=
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- motion-spec (0.1.0)
4
+ motion-spec (0.2.0)
5
5
  motion-require (>= 0.0.6)
6
6
 
7
7
  GEM
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
 
@@ -53,8 +53,16 @@ module MotionSpec
53
53
  @after << block
54
54
  end
55
55
 
56
- def behaves_like(*names)
57
- names.each { |name| instance_eval(&Shared[name]) }
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=
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  module MotionSpec
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
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
- Motion::Require.all('lib/motion-spec/version.rb')
27
+ require_lib_file('version')
13
28
 
14
29
  # Load the output before the core so the core knows how to print
15
- Motion::Require.all(Dir.glob('lib/motion-spec/output/*.rb'))
30
+ require_lib_file('output/*')
16
31
 
17
32
  # All the other core modules in the proper order
18
- Motion::Require.all([
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
- Motion::Require.all(Dir.glob('lib/motion-spec/extensions/*.rb'))
36
+ require_lib_file('extensions/*')
29
37
 
30
38
  # FIXME : Need better detection for iPhone Simulator
31
39
  if defined?(UIDevice) &&
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Bender