Skip to content

Commit

Permalink
Use more consistent naming
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 18, 2013
1 parent 2429580 commit 57fcf2f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
8 changes: 4 additions & 4 deletions opal/opal/rspec.rb
Expand Up @@ -12,12 +12,12 @@
require 'opal/rspec/browser_formatter'
require 'opal/rspec/runner'


RSpec.configure do |config|
# For now, always use our custom formatter for results
config.formatter = OpalRSpec::Runner.default_formatter
config.formatter = Opal::RSpec::Runner.default_formatter

# Always support expect() and .should syntax (we should not do this really..)
config.expect_with(:rspec) { |c| c.syntax = [:should, :expect] }
config.expect_with :rspec do |c|
c.syntax = [:should, :expect]
end
end

5 changes: 2 additions & 3 deletions opal/opal/rspec/browser_formatter.rb
@@ -1,6 +1,6 @@
require 'opal/rspec/text_formatter'

module OpalRSpec
module Opal; module RSpec
class BrowserFormatter < TextFormatter

def start(example_count)
Expand Down Expand Up @@ -186,5 +186,4 @@ def append_to_head
}
CSS
end
end

end; end
7 changes: 3 additions & 4 deletions opal/opal/rspec/runner.rb
@@ -1,4 +1,4 @@
module OpalRSpec
module Opal; module RSpec
class Runner

class << self
Expand Down Expand Up @@ -27,7 +27,7 @@ def autorun
end
end

def initialize(options={}, configuration=RSpec::configuration, world=RSpec::world)
def initialize(options={}, configuration=::RSpec::configuration, world=::RSpec::world)
@options = options
@configuration = configuration
@world = world
Expand All @@ -47,5 +47,4 @@ def run(err=$stdout, out=$stdout)
end
end
end
end

end; end
3 changes: 1 addition & 2 deletions opal/opal/rspec/sprockets_runner.rb.erb
Expand Up @@ -8,5 +8,4 @@
<% require_asset s.sub(/^spec\//, '').sub(/\.(rb|opal)$/, '') %>
<% end %>

OpalRSpec::Runner.autorun

Opal::RSpec::Runner.autorun
5 changes: 2 additions & 3 deletions opal/opal/rspec/text_formatter.rb
@@ -1,4 +1,4 @@
module OpalRSpec
module Opal; module RSpec
class TextFormatter
attr_accessor :example_group
attr_reader :duration, :examples, :output
Expand Down Expand Up @@ -102,5 +102,4 @@ def finish_with_code(code)
}
end
end
end

end; end

0 comments on commit 57fcf2f

Please sign in to comment.