Skip to content

Commit

Permalink
Eliminates more warnings during test runs
Browse files Browse the repository at this point in the history
I've tried to fix everything that I can directly lay my hands on. Some warnings
still stem from the old `.should ==` syntax - that is bound to be replaced.
Others from deep within flexmock - somebody should fix this.
  • Loading branch information
Kaspar Schiess committed Nov 25, 2016
1 parent 91ac15a commit 2ad6b0b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions spec/acceptance/examples_spec.rb
Expand Up @@ -12,7 +12,7 @@ def product_path(str, ext)
end

it "runs successfully" do
stdin, stdout, stderr = Open3.popen3("ruby #{example}")
_, stdout, stderr = Open3.popen3("ruby #{example}")

handle_map = {
stdout => :out,
Expand All @@ -21,7 +21,7 @@ def product_path(str, ext)
expectation_found = handle_map.any? do |io, ext|
name = product_path(example, ext)

if File.exists?(name)
if File.exist?(name)
io.read.strip.should == File.read(name).strip
true
end
Expand Down
4 changes: 2 additions & 2 deletions spec/parslet/atoms_spec.rb
Expand Up @@ -398,7 +398,7 @@ def call(val)
end

describe "combinations thereof (regression)" do
success=[
[
[(str('a').repeat >> str('b').repeat), 'aaabbb']
].each do |(parslet, input)|
describe "#{parslet.inspect} applied to #{input.inspect}" do
Expand All @@ -408,7 +408,7 @@ def call(val)
end
end

inspection=[
[
[str('a'), "'a'" ],
[(str('a') | str('b')).maybe, "('a' / 'b')?" ],
[(str('a') >> str('b')).maybe, "('a' 'b')?" ],
Expand Down
4 changes: 2 additions & 2 deletions spec/parslet/transform/context_spec.rb
Expand Up @@ -27,10 +27,10 @@ def context(*args)
obj.methods.assert.include?(:a)
end
it 'allows inspection' do
obj.inspect.assert.match /@a=1/
obj.inspect.assert.match(/@a=1/)
end
it 'allows conversion to string' do
obj.to_s.assert.match /Parslet::Context:0x/
obj.to_s.assert.match(/Parslet::Context:0x/)
end

context 'when the context is enhanced' do
Expand Down
8 changes: 3 additions & 5 deletions spec/parslet/transform_spec.rb
Expand Up @@ -6,10 +6,6 @@
include Parslet

let(:transform) { Parslet::Transform.new }
attr_reader :transform
before(:each) do
@transform = Parslet::Transform.new
end

class A < Struct.new(:elt); end
class B < Struct.new(:elt); end
Expand Down Expand Up @@ -157,7 +153,9 @@ class OptimusPrimeJunior < OptimusPrime
it "should execute in its own context" do
@bar = 'test'
transform.call_on_match(bindings, proc do
@bar.should_not == 'test'
if instance_variable_defined?("@bar")
instance_variable_get("@bar").should_not == 'test'
end
end)
end
end
Expand Down

0 comments on commit 2ad6b0b

Please sign in to comment.