Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 16dea56

Browse files
committed
begin using the test tools
1 parent f3953d0 commit 16dea56

File tree

7 files changed

+8
-11
lines changed

7 files changed

+8
-11
lines changed

spec/react/component/base_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper'
22

33
if opal?
4-
describe React::Component::Base do
4+
RSpec.describe React::Component::Base, type: :component do
55
after(:each) do
66
React::API.clear_component_class_cache
77
end
@@ -28,6 +28,5 @@ def render
2828
expect(Foo).to render("<span>working</span>")
2929
expect(Bar).to render("<span>working well</span>")
3030
end
31-
3231
end
3332
end

spec/react/component_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper'
22

33
if opal?
4-
describe React::Component do
4+
describe React::Component, type: :component do
55
after(:each) do
66
React::API.clear_component_class_cache
77
end

spec/react/dsl_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper'
22

33
if opal?
4-
describe 'the React DSL' do
4+
RSpec.describe 'the React DSL', type: :component do
55
it "will turn the last string in a block into a element" do
66
stub_const 'Foo', Class.new
77
Foo.class_eval do

spec/react/param_declaration_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper'
22

33
if opal?
4-
describe 'the param macro' do
4+
describe 'the param macro', type: :component do
55
it 'defines collect_other_params_as method on params proxy' do
66
stub_const 'Foo', Class.new(React::Component::Base)
77
Foo.class_eval do

spec/react/react_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require "spec_helper"
22

33
if opal?
4-
describe React do
4+
RSpec.describe React, type: :component do
55
after(:each) do
66
React::API.clear_component_class_cache
77
end

spec/react/tutorial/tutorial_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def render
88
end
99
end
1010

11-
describe 'An Example from the react.rb doc' do
11+
describe 'An Example from the react.rb doc', type: :component do
1212
it 'produces the correct result' do
1313
expect(HelloMessage).to render('<div>Hello World!</div>')
1414
end
@@ -22,7 +22,7 @@ def render
2222
end
2323
end
2424

25-
describe 'Adding state to a component (second tutorial example)' do
25+
describe 'Adding state to a component (second tutorial example)', type: :component do
2626
it "produces the correct result" do
2727
expect(HelloMessage2).to render('<div>Hello @catmando</div>')
2828
end

spec/spec_helper.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ def ruby?
1313

1414
if RUBY_ENGINE == 'opal'
1515
require 'reactive-ruby'
16-
require 'react/test/session'
17-
require 'react/test/matchers/render_html_matcher'
16+
require 'react/test/rspec'
1817
require File.expand_path('../support/react/spec_helpers', __FILE__)
1918

2019
module Opal
@@ -67,7 +66,6 @@ def self.should_immediately_generate(opts={}, &block)
6766

6867
RSpec.configure do |config|
6968
config.include React::SpecHelpers
70-
config.include React::Test::Matchers
7169
config.filter_run_excluding :ruby
7270
end
7371
end

0 commit comments

Comments
 (0)