opal-rspec 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9ed7b3fb8ed58e3aab8713ee071de1e4a4cfa5d
4
- data.tar.gz: b58c1af9c762ddc33afe22af4cd6958119b1cbb4
3
+ metadata.gz: e0e842ffe93edffeb7e5f97c5ebd881053b61642
4
+ data.tar.gz: ea64cb916e97deaa54763bf386ca1e63d08ea832
5
5
  SHA512:
6
- metadata.gz: 7df4bf67b327f5a1e1158ce08451f5195af70316be0e7b592b31e9b19ff9438d1396811281f8c773f7aca6ce8807ed683a56a169a0d159543ef03a99b6c644d4
7
- data.tar.gz: ad69bf9f0e1bbcde4ca73194fb3e0bdd440b7386bd97cd06e89333deb919c98c8adf4836efc4a30f9f861e7af95390ab54b6dfe1581c7183a5091b33e3acaf4e
6
+ metadata.gz: 7d14e6849697b8cca91f618cfabf52ff6abcbc95e7f721949abf3ef250a5606bf9b4a109888f53acf11703407669111fd82e696309d9021b8061d5e129bebd34
7
+ data.tar.gz: f8d41ede39787d54ddf1e6d859ff9adb7d3e2c271f9bd0a62359bd4580c2f2288463caad92cb41f931abd0e34fe559d4f6f03aee7bebb314b14f6ee0b303fc2a
data/CHANGELOG.md CHANGED
@@ -1,4 +1,14 @@
1
- ## edge
1
+ ## 0.4.3 (2015-06-14)
2
+
3
+ * Allow the gem to be run under Opal 0.7 and 0.8
4
+ * Fix some threading issues
5
+ * Avoid some other calls to mutable-strings methods
6
+
7
+ ## 0.4.2 (2015-03-28)
8
+
9
+ * Avoid phantomjs warning messages
10
+
11
+ ## 0.4.1
2
12
 
3
13
  * Remove predicate matcher fixes as Opal supports $1..$9 special gvars.
4
14
 
@@ -15,17 +15,22 @@ module Opal
15
15
  require 'rack'
16
16
  require 'webrick'
17
17
 
18
- server = Thread.new do
19
- app = Opal::Server.new { |s|
20
- s.main = 'opal/rspec/sprockets_runner'
21
- s.append_path 'spec'
22
- s.debug = false
18
+ app = Opal::Server.new { |s|
19
+ s.main = 'opal/rspec/sprockets_runner'
20
+ s.append_path 'spec'
21
+ s.debug = false
23
22
 
24
- block.call s if block
25
- }
23
+ block.call s if block
24
+ }
26
25
 
27
- Rack::Server.start(:app => app, :Port => PORT, :AccessLog => [],
28
- :Logger => WEBrick::Log.new("/dev/null"))
26
+ server = Thread.new do
27
+ Thread.current.abort_on_exception = true
28
+ Rack::Server.start(
29
+ :app => app,
30
+ :Port => PORT,
31
+ :AccessLog => [],
32
+ :Logger => WEBrick::Log.new("/dev/null"),
33
+ )
29
34
  end
30
35
 
31
36
  if `phantomjs -v`.strip.to_i >= 2
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module RSpec
3
- VERSION = '0.4.2'
3
+ VERSION = '0.4.3'
4
4
  end
5
5
  end
@@ -1,3 +1,5 @@
1
+ require 'encoding'
2
+
1
3
  # This breaks on 2.0.0, so it is here ready for when opal bumps to 2.0.0
2
4
  class RSpec::CallerFilter
3
5
  def self.first_non_rspec_line
@@ -78,3 +80,37 @@ module RSpec
78
80
  end
79
81
  end
80
82
  end
83
+
84
+ RSpec::Core::Formatters::DeprecationFormatter::GeneratedDeprecationMessage.class_eval do
85
+ def to_s
86
+ msg = "#{@data[:deprecated]} is deprecated."
87
+ msg += " Use #{@data[:replacement]} instead." if @data[:replacement]
88
+ msg += " Called from #{@data[:call_site]}." if @data[:call_site]
89
+ msg
90
+ end
91
+
92
+ def too_many_warnings_message
93
+ msg = "Too many uses of deprecated '#{type}'."
94
+ msg += " Set config.deprecation_stream to a File for full output."
95
+ msg
96
+ end
97
+ end
98
+
99
+ def (RSpec::Expectations).fail_with(message, expected=nil, actual=nil)
100
+ if !message
101
+ raise ArgumentError, "Failure message is nil. Does your matcher define the " +
102
+ "appropriate failure_message_for_* method to return a string?"
103
+ end
104
+
105
+ if actual && expected
106
+ if all_strings?(actual, expected)
107
+ if any_multiline_strings?(actual, expected)
108
+ message # + "\nDiff:" + differ.diff_as_string(coerce_to_string(actual), coerce_to_string(expected))
109
+ end
110
+ elsif no_procs?(actual, expected) && no_numbers?(actual, expected)
111
+ message # + "\nDiff:" + differ.diff_as_object(actual, expected)
112
+ end
113
+ end
114
+
115
+ raise(RSpec::Expectations::ExpectationNotMetError.new(message))
116
+ end
data/opal-rspec.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.require_paths = ['lib']
16
16
 
17
- s.add_dependency 'opal', '~> 0.7.0'
17
+ s.add_dependency 'opal', ['>= 0.7.0', '< 0.9']
18
18
  s.add_development_dependency 'rake'
19
19
  s.add_development_dependency 'yard'
20
20
  end
data/spec/mock_spec.rb CHANGED
@@ -54,4 +54,10 @@ describe "RSpec mocks" do
54
54
  expect(Time).to receive(:now).once.and_call_original
55
55
  Time.now.should be_kind_of(Time)
56
56
  end
57
+
58
+ describe 'stubs' do
59
+ it 'works and displays deprecation' do
60
+ Object.new.stub :foo
61
+ end
62
+ end
57
63
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Beynon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-27 00:00:00.000000000 Z
11
+ date: 2015-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.7.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '0.9'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: 0.7.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '0.9'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rake
29
35
  requirement: !ruby/object:Gem::Requirement