rspectacular 0.9.2 → 0.10.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.
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env bash
2
+
3
+ trap "rm -f ./tmp/test_fifo; exit;" 2
4
+
5
+ if [ ! -d ./tmp ]; then
6
+ mkdir ./tmp
7
+ fi
8
+
9
+ if [ ! -p ./tmp/test_fifo ]; then
10
+ mkfifo ./tmp/test_fifo
11
+ fi
12
+
13
+ while true; do
14
+ sh -c "$(cat ./tmp/test_fifo)"
15
+ done
@@ -9,14 +9,14 @@ if defined? OmniAuth
9
9
  # Except we don't want OmniAuth to fake anything when doing live tests
10
10
  #
11
11
  RSpec.configure do |config|
12
- config.before(:each, :js => true) do
13
- @previous_omniauth_test_mode = OmniAuth.config.test_mode
12
+ config.around(:each, :js => true) do |example|
13
+ previous_omniauth_test_mode = OmniAuth.config.test_mode
14
14
 
15
15
  OmniAuth.config.test_mode = false
16
- end
17
16
 
18
- config.after(:each, :js => true) do
19
- OmniAuth.config.test_mode = @previous_omniauth_test_mode
17
+ example.run
18
+
19
+ OmniAuth.config.test_mode = previous_omniauth_test_mode
20
20
  end
21
21
  end
22
22
  end
@@ -2,8 +2,13 @@ begin
2
2
  require 'timecop'
3
3
 
4
4
  RSpec.configure do |config|
5
- config.around(:each, :time_mock => true) do |example|
6
- Timecop.freeze(Time.utc(2012, 7, 26, 18, 0, 0))
5
+ config.around(:each, :time_mock => lambda { |v| !!v }) do |example|
6
+ options = example.metadata[:time_mock]
7
+ options = options.is_a?(Hash) ? options : {}
8
+ time = options.is_a?(Time) ? options : (options[:time] || Time.utc(2012, 7, 26, 18, 0, 0))
9
+ mock_type = options.fetch(:type, :freeze)
10
+
11
+ Timecop.send(mock_type, time)
7
12
 
8
13
  example.run
9
14
 
@@ -0,0 +1,18 @@
1
+ begin
2
+ require 'webmock/rspec'
3
+
4
+ RSpec.configure do |config|
5
+ config.around(:each, :web_mock => lambda { |v| !!v }) do |example|
6
+ options = example.metadata[:web_mock]
7
+ options = options.is_a?(Hash) ? options : {}
8
+
9
+ WebMock.disable_net_connect!(options)
10
+
11
+ example.run
12
+
13
+ WebMock.allow_net_connect!
14
+ end
15
+ end
16
+
17
+ rescue LoadError
18
+ end
@@ -1,3 +1,3 @@
1
1
  module RSpectacular
2
- VERSION = '0.9.2'
2
+ VERSION = '0.10.0'
3
3
  end
metadata CHANGED
@@ -1,52 +1,53 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspectacular
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
5
4
  prerelease:
5
+ version: 0.10.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - jfelchner
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-16 00:00:00.000000000 Z
12
+ date: 2013-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
+ prerelease: false
16
+ type: :runtime
15
17
  name: rspec
16
18
  requirement: !ruby/object:Gem::Requirement
19
+ none: false
17
20
  requirements:
18
21
  - - ~>
19
22
  - !ruby/object:Gem::Version
20
23
  version: '2.12'
21
- none: false
22
- prerelease: false
23
- type: :runtime
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
25
26
  requirements:
26
27
  - - ~>
27
28
  - !ruby/object:Gem::Version
28
29
  version: '2.12'
29
- none: false
30
30
  - !ruby/object:Gem::Dependency
31
+ prerelease: false
32
+ type: :runtime
31
33
  name: fuubar
32
34
  requirement: !ruby/object:Gem::Requirement
35
+ none: false
33
36
  requirements:
34
37
  - - ~>
35
38
  - !ruby/object:Gem::Version
36
39
  version: '1.0'
37
- none: false
38
- prerelease: false
39
- type: :runtime
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
41
42
  requirements:
42
43
  - - ~>
43
44
  - !ruby/object:Gem::Version
44
45
  version: '1.0'
45
- none: false
46
46
  description: We rock some RSpec configurations and matchers like it ain't nobody's
47
47
  bidnezz.
48
48
  email: accounts+git@thekompanee.com
49
- executables: []
49
+ executables:
50
+ - rspectacular_test_bootstrap
50
51
  extensions: []
51
52
  extra_rdoc_files:
52
53
  - README.md
@@ -78,6 +79,7 @@ files:
78
79
  - lib/rspectacular/plugins/shoulda.rb
79
80
  - lib/rspectacular/plugins/timecop.rb
80
81
  - lib/rspectacular/plugins/vcr.rb
82
+ - lib/rspectacular/plugins/webmock.rb
81
83
  - lib/rspectacular/plugins.rb
82
84
  - lib/rspectacular/selectors/defaults.rb
83
85
  - lib/rspectacular/selectors.rb
@@ -94,6 +96,7 @@ files:
94
96
  - Rakefile
95
97
  - README.md
96
98
  - spec/spec_helper.rb
99
+ - bin/rspectacular_test_bootstrap
97
100
  homepage: https://github.com/jfelchner/rspectacular
98
101
  licenses: []
99
102
  post_install_message:
@@ -102,17 +105,17 @@ rdoc_options:
102
105
  require_paths:
103
106
  - lib
104
107
  required_ruby_version: !ruby/object:Gem::Requirement
108
+ none: false
105
109
  requirements:
106
110
  - - ! '>='
107
111
  - !ruby/object:Gem::Version
108
112
  version: '0'
109
- none: false
110
113
  required_rubygems_version: !ruby/object:Gem::Requirement
114
+ none: false
111
115
  requirements:
112
116
  - - ! '>='
113
117
  - !ruby/object:Gem::Version
114
118
  version: '0'
115
- none: false
116
119
  requirements: []
117
120
  rubyforge_project: rspectacular
118
121
  rubygems_version: 1.8.25