Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opal/opal-spec
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4c37a3d55f20
Choose a base ref
...
head repository: opal/opal-spec
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 812a9bd30b53
Choose a head ref
  • 2 commits
  • 6 files changed
  • 2 contributors

Commits on Oct 18, 2013

  1. Add example project using opal-spec

    Yutaka HARA committed Oct 18, 2013
    Copy the full SHA
    b136dbc View commit details
  2. Merge pull request #7 from yhara/add_example

    Add example project using opal-spec
    adambeynon committed Oct 18, 2013
    Copy the full SHA
    812a9bd View commit details
Showing with 43 additions and 0 deletions.
  1. +4 −0 example/Gemfile
  2. +8 −0 example/README.md
  3. +10 −0 example/Rakefile
  4. +2 −0 example/opal/stack.rb
  5. +2 −0 example/spec/spec_helper.rb
  6. +17 −0 example/spec/stack_spec.rb
4 changes: 4 additions & 0 deletions example/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

gem 'opal'
gem 'opal-spec'
8 changes: 8 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
opal-spec example
=================

Running spec
------------

$ bundle install
$ rake
10 changes: 10 additions & 0 deletions example/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'bundler'
Bundler.require

require 'opal'
# Help Opal to find your library in ./opal/
Opal.append_path File.expand_path("opal", File.dirname("__FILE__"))

require 'opal/spec/rake_task'
Opal::Spec::RakeTask.new(:default)

2 changes: 2 additions & 0 deletions example/opal/stack.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Stack < Array
end
2 changes: 2 additions & 0 deletions example/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require 'opal-spec'
require 'stack'
17 changes: 17 additions & 0 deletions example/spec/stack_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'spec_helper'

describe Stack do
before do
@stack = Stack.new
end

it "should be initially empty" do
@stack.empty?.should be_true
end

it "can contain an object" do
@stack.push(1)
@stack.pop.should == 1
end
end