Skip to content

Commit

Permalink
Add simple specs for helper methods and subject
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 20, 2013
1 parent a7b6e17 commit f84b578
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion opal/opal/rspec/text_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def dump_summary(duration, example_count, failure_count, pending_count)
@failure_count = failure_count
@pending_count = pending_count

msg = "\n\n#{example_count} examples, #{failure_count} failures (time taken: #{duration})"
msg = "\n#{example_count} examples, #{failure_count} failures (time taken: #{duration})"

if failure_count == 0
green msg
Expand Down
24 changes: 24 additions & 0 deletions spec/example_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,30 @@ def opal_rspec_include_helper
end
end

describe "helper methods" do
def some_helper
:present
end

it "should be available" do
some_helper.should eq(:present)
end

describe "nested group" do
it "should work in nested groups" do
some_helper.should eq(:present)
end
end
end

describe "subject" do
subject { [1, 2, 3] }

it "a new instance should be the subject" do
subject.should be_kind_of(Array)
end
end

describe "Simple expectations" do
before do
@bar = 200
Expand Down

0 comments on commit f84b578

Please sign in to comment.